comparison include/begin_code.h @ 4217:4c4113c2162c SDL-1.2

Fixed bug #706 Ken Bull 2009-02-25 13:22:02 PST Adds Doxygen support for all headers (except config and boilerplate headers) in the include folder for SDL-1.2 revision 4446. While in general SDL is quite thoroughly commented, none of these comments are correctly formatted for Doxygen and are generally inconsistent in their formatting.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 21 Sep 2009 09:38:10 +0000
parents 430e6690c4cd
children 0d4756e57224
comparison
equal deleted inserted replaced
4216:5b99971a27b4 4217:4c4113c2162c
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* This file sets things up for C dynamic library function definitions, 23 /**
24 static inlined functions, and structures aligned at 4-byte alignment. 24 * @file begin_code.h
25 If you don't like ugly C preprocessor code, don't look at this file. :) 25 * This file sets things up for C dynamic library function definitions,
26 */ 26 * static inlined functions, and structures aligned at 4-byte alignment.
27 * If you don't like ugly C preprocessor code, don't look at this file. :)
28 */
27 29
28 /* This shouldn't be nested -- included it around code only. */ 30 /**
31 * @file begin_code.h
32 * This shouldn't be nested -- included it around code only.
33 */
29 #ifdef _begin_code_h 34 #ifdef _begin_code_h
30 #error Nested inclusion of begin_code.h 35 #error Nested inclusion of begin_code.h
31 #endif 36 #endif
32 #define _begin_code_h 37 #define _begin_code_h
33 38
34 /* Some compilers use a special export keyword */ 39 /**
40 * @def DECLSPEC
41 * Some compilers use a special export keyword
42 */
35 #ifndef DECLSPEC 43 #ifndef DECLSPEC
36 # if defined(__BEOS__) || defined(__HAIKU__) 44 # if defined(__BEOS__) || defined(__HAIKU__)
37 # if defined(__GNUC__) 45 # if defined(__GNUC__)
38 # define DECLSPEC __declspec(dllexport) 46 # define DECLSPEC __declspec(dllexport)
39 # else 47 # else
75 # define DECLSPEC 83 # define DECLSPEC
76 # endif 84 # endif
77 # endif 85 # endif
78 #endif 86 #endif
79 87
80 /* By default SDL uses the C calling convention */ 88 /**
89 * @def SDLCALL
90 * By default SDL uses the C calling convention
91 */
81 #ifndef SDLCALL 92 #ifndef SDLCALL
82 # if defined(__WIN32__) && !defined(__GNUC__) 93 # if defined(__WIN32__) && !defined(__GNUC__)
83 # define SDLCALL __cdecl 94 # define SDLCALL __cdecl
84 # elif defined(__OS2__) 95 # elif defined(__OS2__)
85 # if defined (__GNUC__) && __GNUC__ < 4 96 # if defined (__GNUC__) && __GNUC__ < 4
105 #undef DECLSPEC 116 #undef DECLSPEC
106 #define DECLSPEC __declspec(dllexport) 117 #define DECLSPEC __declspec(dllexport)
107 #endif /* !EKA2 */ 118 #endif /* !EKA2 */
108 #endif /* __SYMBIAN32__ */ 119 #endif /* __SYMBIAN32__ */
109 120
110 /* Force structure packing at 4 byte alignment. 121 /**
111 This is necessary if the header is included in code which has structure 122 * @file begin_code.h
112 packing set to an alternate value, say for loading structures from disk. 123 * Force structure packing at 4 byte alignment.
113 The packing is reset to the previous value in close_code.h 124 * This is necessary if the header is included in code which has structure
125 * packing set to an alternate value, say for loading structures from disk.
126 * The packing is reset to the previous value in close_code.h
114 */ 127 */
115 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 128 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
116 #ifdef _MSC_VER 129 #ifdef _MSC_VER
117 #pragma warning(disable: 4103) 130 #pragma warning(disable: 4103)
118 #endif 131 #endif
123 #elif (defined(__MWERKS__) && defined(__MACOS__)) 136 #elif (defined(__MWERKS__) && defined(__MACOS__))
124 #pragma options align=mac68k4byte 137 #pragma options align=mac68k4byte
125 #pragma enumsalwaysint on 138 #pragma enumsalwaysint on
126 #endif /* Compiler needs structure packing set */ 139 #endif /* Compiler needs structure packing set */
127 140
128 /* Set up compiler-specific options for inlining functions */ 141 /**
142 * @def SDL_INLINE_OKAY
143 * Set up compiler-specific options for inlining functions
144 */
129 #ifndef SDL_INLINE_OKAY 145 #ifndef SDL_INLINE_OKAY
130 #ifdef __GNUC__ 146 #ifdef __GNUC__
131 #define SDL_INLINE_OKAY 147 #define SDL_INLINE_OKAY
132 #else 148 #else
133 /* Add any special compiler-specific cases here */ 149 /* Add any special compiler-specific cases here */
148 #endif /* Not a funky compiler */ 164 #endif /* Not a funky compiler */
149 #endif /* Visual C++ */ 165 #endif /* Visual C++ */
150 #endif /* GNU C */ 166 #endif /* GNU C */
151 #endif /* SDL_INLINE_OKAY */ 167 #endif /* SDL_INLINE_OKAY */
152 168
153 /* If inlining isn't supported, remove "__inline__", turning static 169 /**
154 inlined functions into static functions (resulting in code bloat 170 * @def __inline__
155 in all files which include the offending header files) 171 * If inlining isn't supported, remove "__inline__", turning static
156 */ 172 * inlined functions into static functions (resulting in code bloat
173 * in all files which include the offending header files)
174 */
157 #ifndef SDL_INLINE_OKAY 175 #ifndef SDL_INLINE_OKAY
158 #define __inline__ 176 #define __inline__
159 #endif 177 #endif
160 178
161 /* Apparently this is needed by several Windows compilers */ 179 /**
180 * @def NULL
181 * Apparently this is needed by several Windows compilers
182 */
162 #if !defined(__MACH__) 183 #if !defined(__MACH__)
163 #ifndef NULL 184 #ifndef NULL
164 #ifdef __cplusplus 185 #ifdef __cplusplus
165 #define NULL 0 186 #define NULL 0
166 #else 187 #else