github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/image/jxr/jxrlib/common/include/wmspecstrings_adt.h (about) 1 //*@@@+++@@@@****************************************************************** 2 // 3 // Copyright Microsoft Corp. 4 // All rights reserved. 5 // 6 // Redistribution and use in source and binary forms, with or without 7 // modification, are permitted provided that the following conditions are met: 8 // 9 // Redistributions of source code must retain the above copyright notice, 10 // this list of conditions and the following disclaimer. 11 // Redistributions in binary form must reproduce the above copyright notice, 12 // this list of conditions and the following disclaimer in the documentation 13 // and/or other materials provided with the distribution. 14 // 15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 // POSSIBILITY OF SUCH DAMAGE. 26 // 27 //*@@@---@@@@****************************************************************** 28 29 #pragma once 30 /************************************************************************* 31 * DEFINITIONS OF NEW TYPES 32 *************************************************************************/ 33 #if !defined(__midl) 34 #define __$compname_props \ 35 __type_has_adt_prop(compname,nullterminated) \ 36 __type_has_adt_prop(compname,valid_schars) \ 37 __type_has_adt_prop(compname,correct_len) \ 38 __nullterminated 39 #if defined(UNICODE) || defined(_UNICODE) 40 #define __$TCHAR unsigned short 41 #else 42 #define __$TCHAR char 43 #endif 44 typedef __$compname_props char* ValidCompNameA; 45 typedef __$compname_props unsigned short* ValidCompNameW; 46 typedef __$compname_props const unsigned short* ConstValidCompNameW; 47 typedef __$compname_props __$TCHAR* SAL_ValidCompNameT; 48 typedef __$compname_props const __$TCHAR* SAL_ConstValidCompNameT; 49 #undef __$compname_props 50 #undef __$TCHAR 51 #endif 52 53 /************************************************************************* 54 * DEFINITIONS OF INLINE FUNCTIONS FOR CASTING TO THE NEW TYPES : USER 55 *************************************************************************/ 56 #if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 void __inline __nothrow __SAL_ValidCompNameA(__out_has_type_adt_props(ValidCompNameA) const void *expr) { expr;} 61 void __inline __nothrow __SAL_ValidCompNameW(__out_has_type_adt_props(ValidCompNameW) const void *expr) { expr;} 62 #ifdef __cplusplus 63 } 64 #endif 65 #define __assume_ValidCompNameA(expr) __SAL_ValidCompNameA(expr) 66 #define __assume_ValidCompNameW(expr) __SAL_ValidCompNameW(expr) 67 #else 68 #define __assume_ValidCompNameA(expr) 69 #define __assume_ValidCompNameW(expr) 70 #endif 71