From 455154cec427d29bd453692ca4f6ee7a098eb778 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 7 Oct 2018 23:08:43 +0900 Subject: Replaced _BSD_SOURCE, _SVID_SOURCE, _GNU_SOURCE with _DEFAULT_SOURCE. Signed-off-by: Michele Calgaro --- mkspecs/cygwin-g++/qplatformdefs.h | 18 ++---------------- mkspecs/hurd-g++/qplatformdefs.h | 18 ++---------------- mkspecs/linux-clang/qplatformdefs.h | 18 ++---------------- mkspecs/linux-cxx/qplatformdefs.h | 18 ++---------------- mkspecs/linux-ecc-64/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++-32/qplatformdefs.h | 25 ++----------------------- mkspecs/linux-g++-64/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++-sparc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++/qplatformdefs.h | 18 ++---------------- mkspecs/linux-icc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-kcc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-kylix/qplatformdefs.h | 18 ++---------------- mkspecs/linux-pgcc/qplatformdefs.h | 18 ++---------------- src/3rdparty/libpng/pngconf.h | 22 ---------------------- src/moc/moc_yacc.cpp | 2 +- 15 files changed, 27 insertions(+), 238 deletions(-) diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index 181876a7e..fcf57cbe8 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index e2ea4c304..849cf7fa9 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif diff --git a/mkspecs/linux-clang/qplatformdefs.h b/mkspecs/linux-clang/qplatformdefs.h index 9e071fd52..01e1544ee 100644 --- a/mkspecs/linux-clang/qplatformdefs.h +++ b/mkspecs/linux-clang/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-cxx/qplatformdefs.h +++ b/mkspecs/linux-cxx/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-ecc-64/qplatformdefs.h +++ b/mkspecs/linux-ecc-64/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-32/qplatformdefs.h b/mkspecs/linux-g++-32/qplatformdefs.h index 2a5b12f5b..eb160779c 100644 --- a/mkspecs/linux-g++-32/qplatformdefs.h +++ b/mkspecs/linux-g++-32/qplatformdefs.h @@ -1,26 +1,5 @@ -#ifndef TQPLATFORMDEFS_H -#define TQPLATFORMDEFS_H - -// Get TQt defines/settings - -#include "ntqglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-64/qplatformdefs.h b/mkspecs/linux-g++-64/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-g++-64/qplatformdefs.h +++ b/mkspecs/linux-g++-64/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-sparc/qplatformdefs.h b/mkspecs/linux-g++-sparc/qplatformdefs.h index 9e071fd52..01e1544ee 100644 --- a/mkspecs/linux-g++-sparc/qplatformdefs.h +++ b/mkspecs/linux-g++-sparc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h index 9e071fd52..01e1544ee 100644 --- a/mkspecs/linux-g++/qplatformdefs.h +++ b/mkspecs/linux-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-icc/qplatformdefs.h b/mkspecs/linux-icc/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-icc/qplatformdefs.h +++ b/mkspecs/linux-icc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h index a922042e8..33b44f963 100644 --- a/mkspecs/linux-kcc/qplatformdefs.h +++ b/mkspecs/linux-kcc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-kylix/qplatformdefs.h b/mkspecs/linux-kylix/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-kylix/qplatformdefs.h +++ b/mkspecs/linux-kylix/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h index 2a5b12f5b..3ac682c6b 100644 --- a/mkspecs/linux-pgcc/qplatformdefs.h +++ b/mkspecs/linux-pgcc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "ntqglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h index bd5d1c430..19ccaf1e0 100644 --- a/src/3rdparty/libpng/pngconf.h +++ b/src/3rdparty/libpng/pngconf.h @@ -246,30 +246,8 @@ #endif #ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - */ - -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - __png.h__ already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ - /* include setjmp.h for error handling */ # include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ #endif /* PNG_SETJMP_SUPPORTED */ #ifdef BSD diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index 8ae53116a..d384e0baa 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -2117,7 +2117,7 @@ yystrlen (yystr) # endif # ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# if defined __GLIBC__ && defined _STRING_H && defined _DEFAULT_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in -- cgit v1.2.1