From e66045d6761927a98e622abe781aa2de577d2e95 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 25 Oct 2017 15:45:18 +0100 Subject: [PATCH] Include, and make test suite safe. --- mingwrt/ChangeLog | 10 ++++++++++ mingwrt/include/sys/bsdtypes.h | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 9886e4c..1fed35f 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,13 @@ +2017-10-25 Keith Marshall + + Include, and make test suite safe. + + * tests/headers.at (sys/bsdtypes.h): Add reference. + + * include/sys/bsdtypes.h [__IN_MINGWRT_TESTSUITE__]: Add to... + [_BSD_SOURCE || _WINSOCK2_H]: ...these, as conditions for supression + of "ill-advised usage" warning message. + 2017-09-15 Keith Marshall Factor duplicate content out of winsock headers. diff --git a/mingwrt/include/sys/bsdtypes.h b/mingwrt/include/sys/bsdtypes.h index 44d1a3a..37a94a3 100644 --- a/mingwrt/include/sys/bsdtypes.h +++ b/mingwrt/include/sys/bsdtypes.h @@ -5,7 +5,7 @@ * and adopted by the Windows sockets implementation; users are advised * to avoid using these data types, and use standard types instead. * - * $Id$ + * $Id: bsdtypes.h,v 54917a4a822e 2017/10/25 14:32:38 keithmarshall $ * * Abstracted from MinGW.org's WinSock implementation * Copyright (C) 2017, MinGW.org Project @@ -44,13 +44,14 @@ */ #include <_mingw.h> -#if ! (defined _BSD_SOURCE || defined _WINSOCK_H) -/* Users are STRONGLY recommended to avoid using the non-standard BSD - * data types defined herein, unless compiling code which proclaims its - * _BSD_SOURCE heritage, or which uses the Windows Sockets API, (which - * has ill-advisedly adopted them). - */ -#warning "Use of non-standard BSD type definitions is ill-advised." +#if ! __IN_MINGWRT_TESTSUITE__ \ + && ! (defined _BSD_SOURCE || defined _WINSOCK_H) + /* Users are STRONGLY recommended to avoid using the non-standard BSD + * data types defined herein, unless compiling code which proclaims its + * _BSD_SOURCE heritage, or which uses the Windows Sockets API, (which + * has ill-advisedly adopted them). + */ +# warning "Use of non-standard BSD type definitions is ill-advised." #endif /* Use "unsigned foo" instead of these "u_foo" shorthand aliases. @@ -62,4 +63,4 @@ typedef unsigned long u_long; #define _BSDTYPES_DEFINED #endif /* !_BSDTYPES_DEFINED */ -#endif /* _SYS_BSDTYPES_H: $RCSfile$: end of file */ +#endif /* _SYS_BSDTYPES_H: $RCSfile: bsdtypes.h,v $: end of file */ -- 2.11.0