Guest User

mingw/msys2/w32api bug report

a guest
Jan 9th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.72 KB | None | 0 0
  1. Possible compliance issue
  2. -------------------------
  3.  
  4. `ioctlsocket` is defined to take a `u_long *` as an argument. See the MSDN manual for more info: <https://msdn.microsoft.com/en-us/library/windows/desktop/ms738573(v=vs.85).aspx>. It seems as though you've got some kind of preprocessor "magic" screwing things up.
  5.  
  6. > The MinGW Version is the version of the mingw-runtime or w32api that is installed. You can look at the mingw/include/_mingw.h file for this version number.
  7. -- <http://www.mingw.org/reporting_bugs>
  8.  
  9. I couldn't find this file. It seems as though that quote is itself buggy, possibly in multiple ways. What I found was within /usr/include/w32api, instead, and you can find that attached in its entirety below, since it wasn't immediately obvious what you wanted from there...
  10.  
  11. My concern is that the environment I'm working within, fully configured by msys2 installation, treats compliant code as undefined behaviour and with some compiler flags will even flat out reject perfectly compliant code. The following is not perfectly compliant, but it is sufficient to demonstrate the problem. Feel free to substitute `0` for a valid socket descriptor, or try to tweak the example from the MSDN manual (linked to earlier) to get that compiling without any other warnings/errors; the outcome will be the same. I see no way to write code which both complies to the MSDN requirements, yet also compiles with these flags...
  12.  
  13. ---
  14.  
  15. Owner@Optiplex-780 MINGW64 /c/Users/Owner/Documents/Seb/substrate
  16. $ cat testcase.c
  17. #include <Winsock2.h>
  18.  
  19. int main(void) {
  20. ioctlsocket(0, FIONBIO, &(u_long){1});
  21. }
  22.  
  23. Owner@Optiplex-780 MINGW64 /c/Users/Owner/Documents/Seb/substrate
  24. $ gcc -pedantic-errors -std=c11 testcase.c -lws2_32
  25. testcase.c: In function ‘main’:
  26. testcase.c:4:33: error: passing argument 3 of ‘ioctlsocket’ from incompatible pointer type [-Wincompatible-pointer-types]
  27. ioctlsocket(0, FIONBIO, &(u_long){1});
  28. ^
  29. In file included from testcase.c:1:0:
  30. /usr/include/w32api/Winsock2.h:977:34: note: expected ‘__ms_u_long * {aka unsigned int *}’ but argument is of type ‘u_long * {aka long unsigned int *}’
  31. WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
  32. ^~~~~~~~~~~
  33.  
  34. Owner@Optiplex-780 MINGW64 /c/Users/Owner/Documents/Seb/substrate
  35. $ gcc -v
  36. Using built-in specs.
  37. COLLECT_GCC=gcc
  38. COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/6.4.0/lto-wrapper.exe
  39. Target: x86_64-pc-msys
  40. Configured with: /msys_scripts/gcc/src/gcc-6.4.0/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
  41. Thread model: posix
  42. gcc version 6.4.0 (GCC)
  43.  
  44. Owner@Optiplex-780 MINGW64 /c/Users/Owner/Documents/Seb/substrate
  45. $ ld -v
  46. GNU ld (GNU Binutils) 2.28
  47.  
  48. Owner@Optiplex-780 MSYS /
  49. $ cat /usr/include/w32api/_mingw.h
  50. /**
  51. * This file has no copyright assigned and is placed in the Public Domain.
  52. * This file is part of the mingw-w64 runtime package.
  53. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  54. */
  55.  
  56. #ifndef _INC__MINGW_H
  57. #define _INC__MINGW_H
  58.  
  59.  
  60.  
  61. #include "_mingw_mac.h"
  62. #include "_mingw_secapi.h"
  63.  
  64. /* Include _cygwin.h if we're building a Cygwin application. */
  65. #ifdef __CYGWIN__
  66. #include "_cygwin.h"
  67. #endif
  68.  
  69. /* Target specific macro replacement for type "long". In the Windows API,
  70. the type long is always 32 bit, even if the target is 64 bit (LLP64).
  71. On 64 bit Cygwin, the type long is 64 bit (LP64). So, to get the right
  72. sized definitions and declarations, all usage of type long in the Windows
  73. headers have to be replaced by the below defined macro __LONG32. */
  74. #ifndef __LP64__ /* 32 bit target, 64 bit Mingw target */
  75. #define __LONG32 long
  76. #else /* 64 bit Cygwin target */
  77. #define __LONG32 int
  78. #endif
  79.  
  80. /* C/C++ specific language defines. */
  81. #ifdef _WIN64
  82. #ifdef __stdcall
  83. #undef __stdcall
  84. #endif
  85. #define __stdcall
  86. #endif
  87.  
  88. #ifndef __GNUC__
  89. # ifndef __MINGW_IMPORT
  90. # define __MINGW_IMPORT __declspec(dllimport)
  91. # endif
  92. # ifndef _CRTIMP
  93. # define _CRTIMP __declspec(dllimport)
  94. # endif
  95. # define __DECLSPEC_SUPPORTED
  96. # define __attribute__(x) /* nothing */
  97. #else /* __GNUC__ */
  98. # ifdef __declspec
  99. # ifndef __MINGW_IMPORT
  100. /* Note the extern. This is needed to work around GCC's
  101. limitations in handling dllimport attribute. */
  102. # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
  103. # endif
  104. # ifndef _CRTIMP
  105. # undef __USE_CRTIMP
  106. # if !defined (_CRTBLD) && !defined (_SYSCRT)
  107. # define __USE_CRTIMP 1
  108. # endif
  109. # ifdef __USE_CRTIMP
  110. # define _CRTIMP __attribute__ ((__dllimport__))
  111. # else
  112. # define _CRTIMP
  113. # endif
  114. # endif
  115. # define __DECLSPEC_SUPPORTED
  116. # else /* __declspec */
  117. # undef __DECLSPEC_SUPPORTED
  118. # undef __MINGW_IMPORT
  119. # ifndef _CRTIMP
  120. # define _CRTIMP
  121. # endif
  122. # endif /* __declspec */
  123. #endif /* __GNUC__ */
  124.  
  125. #ifdef _MSC_VER
  126. #define USE___UUIDOF 1
  127. #else
  128. #define USE___UUIDOF 0
  129. #endif
  130.  
  131. #if !defined(_MSC_VER) && !defined(_inline)
  132. #define _inline __inline
  133. #endif
  134.  
  135. #ifdef __cplusplus
  136. # define __CRT_INLINE inline
  137. #elif defined(_MSC_VER)
  138. # define __CRT_INLINE __inline
  139. #else
  140. # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) \
  141. || (defined (__clang__))
  142. # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
  143. # else
  144. # define __CRT_INLINE extern __inline__
  145. # endif
  146. #endif
  147.  
  148. #if !defined(__MINGW_INTRIN_INLINE) && defined(__GNUC__)
  149. #define __MINGW_INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
  150. #endif
  151.  
  152. #ifndef __CYGWIN__
  153. #ifdef __NO_INLINE__
  154. #undef __CRT__NO_INLINE
  155. #define __CRT__NO_INLINE 1
  156. #endif
  157. #endif
  158.  
  159. #ifdef __cplusplus
  160. # define __UNUSED_PARAM(x)
  161. #else
  162. # ifdef __GNUC__
  163. # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
  164. # else
  165. # define __UNUSED_PARAM(x) x
  166. # endif
  167. #endif
  168.  
  169. #ifndef __GNUC__
  170. # ifdef _MSC_VER
  171. # define __restrict__ __restrict
  172. # else
  173. # define __restrict__ /* nothing */
  174. # endif
  175. #endif /* !__GNUC__ */
  176.  
  177. #if __MINGW_GNUC_PREREQ (3,1) && !defined __GNUG__
  178. # define __restrict_arr __restrict
  179. #elif defined(_MSC_VER)
  180. # define __restrict_arr __restrict
  181. #else
  182. # ifdef __GNUC__
  183. # define __restrict_arr /* Not supported in old GCC. */
  184. # else
  185. # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  186. # define __restrict_arr restrict
  187. # else
  188. # define __restrict_arr /* Not supported. */
  189. # endif
  190. # endif
  191. #endif
  192.  
  193. #ifdef __GNUC__
  194. #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
  195. #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
  196. #elif __MINGW_MSC_PREREQ(12, 0)
  197. #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
  198. #define __MINGW_ATTRIB_CONST
  199. #else
  200. #define __MINGW_ATTRIB_NORETURN
  201. #define __MINGW_ATTRIB_CONST
  202. #endif
  203.  
  204. #if __MINGW_GNUC_PREREQ (3, 0)
  205. #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
  206. #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
  207. #elif __MINGW_MSC_PREREQ(14, 0)
  208. #define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
  209. #define __MINGW_ATTRIB_PURE
  210. #else
  211. #define __MINGW_ATTRIB_MALLOC
  212. #define __MINGW_ATTRIB_PURE
  213. #endif
  214.  
  215. /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
  216. variadiac macro facility, because variadic macros cause syntax
  217. errors with --traditional-cpp. */
  218. #if __MINGW_GNUC_PREREQ (3, 3)
  219. #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
  220. #else
  221. #define __MINGW_ATTRIB_NONNULL(arg)
  222. #endif /* GNUC >= 3.3 */
  223.  
  224. #ifdef __GNUC__
  225. #define __MINGW_ATTRIB_UNUSED __attribute__ ((__unused__))
  226. #else
  227. #define __MINGW_ATTRIB_UNUSED
  228. #endif /* ATTRIBUTE_UNUSED */
  229.  
  230. #if __MINGW_GNUC_PREREQ (3, 1)
  231. #define __MINGW_ATTRIB_USED __attribute__ ((__used__))
  232. #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
  233. #elif __MINGW_MSC_PREREQ(12, 0)
  234. #define __MINGW_ATTRIB_USED
  235. #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
  236. #else
  237. #define __MINGW_ATTRIB_USED __MINGW_ATTRIB_UNUSED
  238. #define __MINGW_ATTRIB_DEPRECATED
  239. #endif /* GNUC >= 3.1 */
  240.  
  241. #if __MINGW_GNUC_PREREQ (3, 3)
  242. #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
  243. #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
  244. #define __MINGW_NOTHROW __declspec(nothrow)
  245. #else
  246. #define __MINGW_NOTHROW
  247. #endif
  248.  
  249. #if __MINGW_GNUC_PREREQ (4, 4)
  250. #define __MINGW_ATTRIB_NO_OPTIMIZE __attribute__((__optimize__ ("0")))
  251. #else
  252. #define __MINGW_ATTRIB_NO_OPTIMIZE
  253. #endif
  254.  
  255. #if __MINGW_GNUC_PREREQ (4, 4)
  256. #define __MINGW_PRAGMA_PARAM(x) _Pragma (#x)
  257. #elif __MINGW_MSC_PREREQ (13, 1)
  258. #define __MINGW_PRAGMA_PARAM(x) __pragma (x)
  259. #else
  260. #define __MINGW_PRAGMA_PARAM(x)
  261. #endif
  262.  
  263. #define __MINGW_BROKEN_INTERFACE(x) \
  264. __MINGW_PRAGMA_PARAM(message ("Interface " _CRT_STRINGIZE(x) \
  265. " has unverified layout."))
  266.  
  267. #ifndef __MSVCRT_VERSION__
  268. /* High byte is the major version, low byte is the minor. */
  269. # define __MSVCRT_VERSION__ 0x0700
  270. #endif
  271.  
  272.  
  273. #ifndef _WIN32_WINNT
  274. #define _WIN32_WINNT 0x502
  275. #endif
  276.  
  277. #ifndef _INT128_DEFINED
  278. #define _INT128_DEFINED
  279. #ifdef __GNUC__
  280. #define __int8 char
  281. #define __int16 short
  282. #define __int32 int
  283. #define __int64 long long
  284. #ifdef _WIN64
  285. #if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) && \
  286. !defined(__SIZEOF_INT128__) /* clang >= 3.1 has __int128 but no size macro */
  287. #define __SIZEOF_INT128__ 16
  288. #endif
  289. #ifndef __SIZEOF_INT128__
  290. typedef int __int128 __attribute__ ((__mode__ (TI)));
  291. #endif
  292. #endif
  293. #endif /* __GNUC__ */
  294. #endif /* _INT128_DEFINED */
  295.  
  296. #ifdef __GNUC__
  297. #define __ptr32
  298. #define __ptr64
  299. #ifndef __unaligned
  300. #define __unaligned
  301. #endif
  302. #ifndef __w64
  303. #define __w64
  304. #endif
  305. #ifdef __cplusplus
  306. #define __forceinline inline __attribute__((__always_inline__))
  307. #else
  308. #define __forceinline extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
  309. #endif /* __cplusplus */
  310. #endif /* __GNUC__ */
  311.  
  312. #if !defined(_WIN32) && !defined(__CYGWIN__)
  313. #error Only Win32 target is supported!
  314. #endif
  315.  
  316. #ifndef __nothrow
  317. #ifdef __cplusplus
  318. #define __nothrow __MINGW_NOTHROW
  319. #else
  320. #define __nothrow
  321. #endif
  322. #endif /* __nothrow */
  323.  
  324. #include <vadefs.h> /* other headers depend on this include */
  325.  
  326. #ifndef _CRT_STRINGIZE
  327. #define __CRT_STRINGIZE(_Value) #_Value
  328. #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
  329. #endif /* _CRT_STRINGIZE */
  330.  
  331. #ifndef _CRT_WIDE
  332. #define __CRT_WIDE(_String) L ## _String
  333. #define _CRT_WIDE(_String) __CRT_WIDE(_String)
  334. #endif /* _CRT_WIDE */
  335.  
  336. #ifndef _W64
  337. #define _W64
  338. #endif
  339.  
  340. #ifndef _CRTIMP_NOIA64
  341. #ifdef __ia64__
  342. #define _CRTIMP_NOIA64
  343. #else
  344. #define _CRTIMP_NOIA64 _CRTIMP
  345. #endif
  346. #endif /* _CRTIMP_NOIA64 */
  347.  
  348. #ifndef _CRTIMP2
  349. #define _CRTIMP2 _CRTIMP
  350. #endif
  351.  
  352. #ifndef _CRTIMP_ALTERNATIVE
  353. #define _CRTIMP_ALTERNATIVE _CRTIMP
  354. #define _CRT_ALTERNATIVE_IMPORTED
  355. #endif /* _CRTIMP_ALTERNATIVE */
  356.  
  357. #ifndef _MRTIMP2
  358. #define _MRTIMP2 _CRTIMP
  359. #endif
  360.  
  361. /* We have to define _DLL for gcc based mingw version. This define is set
  362. by VC, when DLL-based runtime is used. So, gcc based runtime just have
  363. DLL-base runtime, therefore this define has to be set.
  364. As our headers are possibly used by windows compiler having a static
  365. C-runtime, we make this definition gnu compiler specific here. */
  366. #if !defined (_DLL) && defined (__GNUC__)
  367. #define _DLL
  368. #endif
  369.  
  370. #ifndef _MT
  371. #define _MT
  372. #endif
  373.  
  374. #ifndef _MCRTIMP
  375. #define _MCRTIMP _CRTIMP
  376. #endif
  377.  
  378. #ifndef _CRTIMP_PURE
  379. #define _CRTIMP_PURE _CRTIMP
  380. #endif
  381.  
  382. #ifndef _PGLOBAL
  383. #define _PGLOBAL
  384. #endif
  385.  
  386. #ifndef _AGLOBAL
  387. #define _AGLOBAL
  388. #endif
  389.  
  390. #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
  391. #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
  392.  
  393. #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
  394. #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
  395. #endif
  396.  
  397. #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
  398. #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
  399. #endif
  400.  
  401. #ifndef _CRT_MANAGED_HEAP_DEPRECATE
  402. #define _CRT_MANAGED_HEAP_DEPRECATE
  403. #endif
  404.  
  405. #ifndef _CRT_OBSOLETE
  406. #define _CRT_OBSOLETE(_NewItem)
  407. #endif
  408.  
  409. #ifndef __WIDL__
  410.  
  411. #if defined (_WIN32) && !defined (_WIN64) && !defined (__MINGW_USE_VC2005_COMPAT)
  412. #ifndef _USE_32BIT_TIME_T
  413. #define _USE_32BIT_TIME_T
  414. #endif
  415. #endif
  416.  
  417. #ifndef _CONST_RETURN
  418. #define _CONST_RETURN
  419. #endif
  420.  
  421. #ifndef UNALIGNED
  422. #if defined(_M_IA64) || defined(_M_AMD64)
  423. #define UNALIGNED __unaligned
  424. #else
  425. #define UNALIGNED
  426. #endif
  427. #endif /* UNALIGNED */
  428.  
  429. #ifndef _CRT_ALIGN
  430. #ifdef _MSC_VER
  431. #define _CRT_ALIGN(x) __declspec(align(x))
  432. #else /* __GNUC__ */
  433. #define _CRT_ALIGN(x) __attribute__ ((__aligned__ (x)))
  434. #endif
  435. #endif /* _CRT_ALIGN */
  436.  
  437. #endif /* __WIDL__ */
  438.  
  439. #ifndef __CRTDECL
  440. #define __CRTDECL __cdecl
  441. #endif
  442.  
  443. #define _ARGMAX 100
  444.  
  445. #ifndef _TRUNCATE
  446. #define _TRUNCATE ((size_t)-1)
  447. #endif
  448.  
  449. #ifndef _CRT_UNUSED
  450. #define _CRT_UNUSED(x) (void)x
  451. #endif
  452.  
  453. /* MSVC defines _NATIVE_NULLPTR_SUPPORTED when nullptr is supported. We emulate it here for GCC. */
  454. #if __MINGW_GNUC_PREREQ(4, 6)
  455. #if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
  456. #define _NATIVE_NULLPTR_SUPPORTED
  457. #endif
  458. #endif
  459.  
  460. /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
  461. Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  462. #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
  463. || defined (_ISOC99_SOURCE) \
  464. || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
  465. || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
  466. || defined (_SVID_SOURCE)) \
  467. && !defined(__USE_MINGW_ANSI_STDIO)
  468. /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
  469. * and If user did _not_ specify it explicitly... */
  470. # define __USE_MINGW_ANSI_STDIO 1
  471. #endif
  472.  
  473. /* _dowildcard is an int that controls the globbing of the command line.
  474. * The MinGW32 (mingw.org) runtime calls it _CRT_glob, so we are adding
  475. * a compatibility definition here: you can use either of _CRT_glob or
  476. * _dowildcard .
  477. * If _dowildcard is non-zero, the command line will be globbed: *.*
  478. * will be expanded to be all files in the startup directory.
  479. * In the mingw-w64 library a _dowildcard variable is defined as being
  480. * 0, therefore command line globbing is DISABLED by default. To turn it
  481. * on and to leave wildcard command line processing MS's globbing code,
  482. * include a line in one of your source modules defining _dowildcard and
  483. * setting it to -1, like so:
  484. * int _dowildcard = -1;
  485. */
  486. #undef _CRT_glob
  487. #define _CRT_glob _dowildcard
  488.  
  489.  
  490. #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
  491. #define NONAMELESSUNION 1
  492. #endif
  493. #if defined(NONAMELESSSTRUCT) && \
  494. !defined(NONAMELESSUNION)
  495. #define NONAMELESSUNION 1
  496. #endif
  497. #if defined(NONAMELESSUNION) && \
  498. !defined(NONAMELESSSTRUCT)
  499. #define NONAMELESSSTRUCT 1
  500. #endif
  501.  
  502. #ifndef __ANONYMOUS_DEFINED
  503. #define __ANONYMOUS_DEFINED
  504. #define _ANONYMOUS_UNION __MINGW_EXTENSION
  505. #define _ANONYMOUS_STRUCT __MINGW_EXTENSION
  506. #ifndef NONAMELESSUNION
  507. #define _UNION_NAME(x)
  508. #define _STRUCT_NAME(x)
  509. #else /* NONAMELESSUNION */
  510. #define _UNION_NAME(x) x
  511. #define _STRUCT_NAME(x) x
  512. #endif
  513. #endif /* __ANONYMOUS_DEFINED */
  514.  
  515. #ifndef DUMMYUNIONNAME
  516. # ifdef NONAMELESSUNION
  517. # define DUMMYUNIONNAME u
  518. # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
  519. # define DUMMYUNIONNAME2 u2
  520. # define DUMMYUNIONNAME3 u3
  521. # define DUMMYUNIONNAME4 u4
  522. # define DUMMYUNIONNAME5 u5
  523. # define DUMMYUNIONNAME6 u6
  524. # define DUMMYUNIONNAME7 u7
  525. # define DUMMYUNIONNAME8 u8
  526. # define DUMMYUNIONNAME9 u9
  527. # else /* NONAMELESSUNION */
  528. # define DUMMYUNIONNAME
  529. # define DUMMYUNIONNAME1 /* Wine uses this variant */
  530. # define DUMMYUNIONNAME2
  531. # define DUMMYUNIONNAME3
  532. # define DUMMYUNIONNAME4
  533. # define DUMMYUNIONNAME5
  534. # define DUMMYUNIONNAME6
  535. # define DUMMYUNIONNAME7
  536. # define DUMMYUNIONNAME8
  537. # define DUMMYUNIONNAME9
  538. # endif
  539. #endif /* DUMMYUNIONNAME */
  540.  
  541. #ifndef DUMMYSTRUCTNAME
  542. # ifdef NONAMELESSUNION
  543. # define DUMMYSTRUCTNAME s
  544. # define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
  545. # define DUMMYSTRUCTNAME2 s2
  546. # define DUMMYSTRUCTNAME3 s3
  547. # define DUMMYSTRUCTNAME4 s4
  548. # define DUMMYSTRUCTNAME5 s5
  549. # else
  550. # define DUMMYSTRUCTNAME
  551. # define DUMMYSTRUCTNAME1 /* Wine uses this variant */
  552. # define DUMMYSTRUCTNAME2
  553. # define DUMMYSTRUCTNAME3
  554. # define DUMMYSTRUCTNAME4
  555. # define DUMMYSTRUCTNAME5
  556. # endif
  557. #endif /* DUMMYSTRUCTNAME */
  558.  
  559.  
  560. /* Macros for __uuidof template-based emulation */
  561. #if defined(__cplusplus) && (USE___UUIDOF == 0)
  562.  
  563. #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
  564. extern "C++" { \
  565. template<> inline const GUID &__mingw_uuidof<type>() { \
  566. static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
  567. return __uuid_inst; \
  568. } \
  569. template<> inline const GUID &__mingw_uuidof<type*>() { \
  570. return __mingw_uuidof<type>(); \
  571. } \
  572. }
  573.  
  574. #define __uuidof(type) __mingw_uuidof<__typeof(type)>()
  575.  
  576. #else
  577.  
  578. #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
  579.  
  580. #endif
  581.  
  582. #ifdef __cplusplus
  583. extern "C" {
  584. #endif
  585.  
  586. #ifdef __MINGW_INTRIN_INLINE
  587. #if !defined (__clang__)
  588. void __cdecl __debugbreak(void);
  589. __MINGW_INTRIN_INLINE void __cdecl __debugbreak(void)
  590. {
  591. __asm__ __volatile__("int {$}3":);
  592. }
  593. #endif
  594. #endif
  595.  
  596. /* mingw-w64 specific functions: */
  597. const char *__mingw_get_crt_info (void);
  598.  
  599. #ifdef __cplusplus
  600. }
  601. #endif
  602.  
  603. #endif /* _INC__MINGW_H */
  604.  
  605. #ifndef MINGW_SDK_INIT
  606. #define MINGW_SDK_INIT
  607.  
  608. #ifdef MINGW_HAS_SECURE_API
  609. #define __STDC_SECURE_LIB__ 200411L
  610. #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
  611. #endif
  612.  
  613. #ifndef __WIDL__
  614. #include "sdks/_mingw_directx.h"
  615. #include "sdks/_mingw_ddk.h"
  616. #endif
  617.  
  618. #endif /* MINGW_SDK_INIT */
  619.  
  620. $ uname -a
  621. MSYS_NT-6.1 Optiplex-780 2.9.0(0.318/5/3) 2017-09-13 23:16 x86_64 Msys
  622.  
  623. $ cat /usr/include/w32api/w32api.h | grep VERSION
  624. #define __W32API_VERSION 3.14
  625. #define __W32API_MAJOR_VERSION 3
  626. #define __W32API_MINOR_VERSION 14
Advertisement
Add Comment
Please, Sign In to add comment