comparison src/os/win32/ngx_atomic.h @ 5360:3d2d3e1cf427

Win32: MinGW GCC compatibility. Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 04 Sep 2013 20:48:28 +0400
parents d620f497c50f
children 2cd019520210
comparison
equal deleted inserted replaced
5359:2fda9065d0f4 5360:3d2d3e1cf427
19 typedef uint32_t ngx_atomic_uint_t; 19 typedef uint32_t ngx_atomic_uint_t;
20 typedef volatile ngx_atomic_uint_t ngx_atomic_t; 20 typedef volatile ngx_atomic_uint_t ngx_atomic_t;
21 #define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1) 21 #define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
22 22
23 23
24 #if defined( __WATCOMC__ ) || defined( __BORLANDC__ ) || ( _MSC_VER >= 1300 ) 24 #if defined( __WATCOMC__ ) || defined( __BORLANDC__ ) || defined(__GNUC__) \
25 || ( _MSC_VER >= 1300 )
25 26
26 /* the new SDK headers */ 27 /* the new SDK headers */
27 28
28 #define ngx_atomic_cmp_set(lock, old, set) \ 29 #define ngx_atomic_cmp_set(lock, old, set) \
29 ((ngx_atomic_uint_t) InterlockedCompareExchange((long *) lock, set, old) \ 30 ((ngx_atomic_uint_t) InterlockedCompareExchange((long *) lock, set, old) \