src/cx/common.h

changeset 682
34120a385fc8
parent 674
dc514a5d42a5
child 759
475335643af4
equal deleted inserted replaced
681:502105523db7 682:34120a385fc8
87 #define UCX_VERSION_MINOR 0 87 #define UCX_VERSION_MINOR 0
88 88
89 /** Version constant which ensures to increase monotonically. */ 89 /** Version constant which ensures to increase monotonically. */
90 #define UCX_VERSION (((UCX_VERSION_MAJOR)<<16)|UCX_VERSION_MINOR) 90 #define UCX_VERSION (((UCX_VERSION_MAJOR)<<16)|UCX_VERSION_MINOR)
91 91
92 // Common Includes
93
92 #include <stdlib.h> 94 #include <stdlib.h>
93 #include <stddef.h> 95 #include <stddef.h>
94 #include <stdbool.h> 96 #include <stdbool.h>
95 #include <stdint.h> 97 #include <stdint.h>
98 #include <sys/types.h>
96 99
97 /** 100 /**
98 * Function pointer compatible with fwrite-like functions. 101 * Function pointer compatible with fwrite-like functions.
99 */ 102 */
100 typedef size_t (*cx_write_func)( 103 typedef size_t (*cx_write_func)(
112 size_t, 115 size_t,
113 size_t, 116 size_t,
114 void * 117 void *
115 ); 118 );
116 119
117 #ifdef _WIN32
118 120
119 #ifdef __MINGW32__ 121 // Compiler specific stuff
120 #include <sys/types.h>
121 #endif // __MINGW32__
122
123 #else // !_WIN32
124
125 #include <sys/types.h>
126
127 #endif // _WIN32
128 122
129 #ifndef __GNUC__ 123 #ifndef __GNUC__
130 /** 124 /**
131 * Removes GNU C attributes where they are not supported. 125 * Removes GNU C attributes where they are not supported.
132 */ 126 */
133 #define __attribute__(x) 127 #define __attribute__(x)
134 #endif 128 #endif
135 129
130 #ifdef _MSC_VER
131
132 // fix missing ssize_t definition
133 #include <BaseTsd.h>
134 typedef SSIZE_T ssize_t;
135
136 // fix missing _Thread_local support
137 #define _Thread_local __declspec(thread)
138
139 #endif
140
136 #endif // UCX_COMMON_H 141 #endif // UCX_COMMON_H

mercurial