civodul pushed a commit to branch main
in repository guile.

commit ff4d79074c7ab35ac4ceb3ad76fd3644fc9c148e
Author: Hannes Müller <>
AuthorDate: Sat Dec 21 19:20:17 2024 +0100

    libguile/scm.h: Allow compilation with ‘-Werror=undef’.
    
    * libguile/scm.h: BUILDING_LIBGUILE is not always defined. This is
    signaled by -Werror=undef in code using libguile. This patch fixes
    commit dc3a3a84f908f4a16e95a2c3bb412861521960dc
    * NEWS: Update.
    
    Signed-off-by: Ludovic Courtès <l...@gnu.org>
---
 NEWS           | 2 ++
 libguile/scm.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 135615fab..5321e953d 100644
--- a/NEWS
+++ b/NEWS
@@ -78,6 +78,8 @@ every line in a file.
    available or the port isn't a tty).
 ** Fix build error when cross-compiling to MinGW
    (<https://bugs.gnu.org/75642>)
+** Change <libguile/scm.h> to allow compilation with -Werror=undef
+   (<https://bugs.gnu.org/75085>)
 
 
 Changes in 3.0.10 (since 3.0.9)
diff --git a/libguile/scm.h b/libguile/scm.h
index 4d079b1a8..180b40159 100644
--- a/libguile/scm.h
+++ b/libguile/scm.h
@@ -718,9 +718,9 @@ enum scm_tc8_tags
 
 /* SCM_API is a macro prepended to all function and data definitions
    which should be exported from libguile. */
-#if BUILDING_LIBGUILE && HAVE_VISIBILITY
+#if defined BUILDING_LIBGUILE && HAVE_VISIBILITY
 # define SCM_API extern __attribute__((__visibility__("default")))
-#elif BUILDING_LIBGUILE && (defined _WIN32 || defined __CYGWIN__)
+#elif defined BUILDING_LIBGUILE && (defined _WIN32 || defined __CYGWIN__)
 # define SCM_API __declspec(dllexport) extern
 #elif defined _WIN32 || defined __CYGWIN__
 # define SCM_API __declspec(dllimport) extern

Reply via email to