From 04074667898e4a3fa8f469d50e77987fea58a8c7 Mon Sep 17 00:00:00 2001 From: Bill Sommerfeld Date: Mon, 5 May 2025 15:58:23 -0700 Subject: [PATCH] Drop the definition of __EXTENSIONS__ from three files and instead move it to compiler options if on a platform that needs it. --- CMakeLists.txt | 8 +++++++- common/config.h.cmake.in | 5 ----- libgnucash/backend/xml/sixtp-dom-generators.cpp | 3 --- libgnucash/backend/xml/sixtp-utils.cpp | 1 - libgnucash/engine/gnc-date.cpp | 1 - 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e925a0b8df..afbc837828 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -788,7 +788,13 @@ set (_ALL_SOURCE 1) set (_GNU_SOURCE 1) set (_POSIX_PTHREAD_SEMANTICS 1) set (_TANDEM_SOURCE 1) -set (__EXTENSIONS__ 1) +endif() + +# Solaris header files limit the visibility of non-standard extensions +# unless __EXTENSIONS__ is defined. We need some of those +# non-standard interfaces. +if (CMAKE_SYSTEM_NAME MATCHES "SunOS") +add_compile_definitions(__EXTENSIONS__=1) endif() check_struct_has_member("struct tm" tm_gmtoff time.h have_struct_tm_gmtoff) diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in index 77d555ccfa..e1ed479509 100644 --- a/common/config.h.cmake.in +++ b/common/config.h.cmake.in @@ -290,11 +290,6 @@ #ifndef _TANDEM_SOURCE #cmakedefine _TANDEM_SOURCE 1 #endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -#cmakedefine __EXTENSIONS__ 1 -#endif - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp index a949b65a52..98cba3bfeb 100644 --- a/libgnucash/backend/xml/sixtp-dom-generators.cpp +++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp @@ -21,9 +21,6 @@ * * ********************************************************************/ #include - -#define __EXTENSIONS__ - #include #include diff --git a/libgnucash/backend/xml/sixtp-utils.cpp b/libgnucash/backend/xml/sixtp-utils.cpp index 4e3539ad3c..575ae60f24 100644 --- a/libgnucash/backend/xml/sixtp-utils.cpp +++ b/libgnucash/backend/xml/sixtp-utils.cpp @@ -21,7 +21,6 @@ * * ********************************************************************/ -#define __EXTENSIONS__ #include #include diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp index f64863888d..2302ae6295 100644 --- a/libgnucash/engine/gnc-date.cpp +++ b/libgnucash/engine/gnc-date.cpp @@ -25,7 +25,6 @@ * * \********************************************************************/ -#define __EXTENSIONS__ #include #include