From dc3a3a84f908f4a16e95a2c3bb412861521960dc Mon Sep 17 00:00:00 2001 From: Michael Gran Date: Thu, 1 Jun 2023 18:51:27 -0700 Subject: [PATCH] Modify SCM_API for DLLs In https://gcc.gnu.org/wiki/Visibility, they recommend _WIN32 and __CYGWIN__ as the test defines for dllexport. Also, logic is incorrect since HAVE_VISIBILITY can be defined but zero. * libguile/scm.h (SCM_API): modify #ifdef logic --- libguile/scm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libguile/scm.h b/libguile/scm.h index e69552893..4d079b1a8 100644 --- a/libguile/scm.h +++ b/libguile/scm.h @@ -1,7 +1,7 @@ #ifndef SCM_SCM_H #define SCM_SCM_H -/* Copyright 1995-2004,2006-2015,2017-2019 +/* Copyright 1995-2004,2006-2015,2017-2019,2023 Free Software Foundation, Inc. This file is part of Guile. @@ -718,11 +718,11 @@ enum scm_tc8_tags /* SCM_API is a macro prepended to all function and data definitions which should be exported from libguile. */ -#if defined BUILDING_LIBGUILE && defined HAVE_VISIBILITY +#if BUILDING_LIBGUILE && HAVE_VISIBILITY # define SCM_API extern __attribute__((__visibility__("default"))) -#elif defined BUILDING_LIBGUILE && defined _MSC_VER +#elif BUILDING_LIBGUILE && (defined _WIN32 || defined __CYGWIN__) # define SCM_API __declspec(dllexport) extern -#elif defined _MSC_VER +#elif defined _WIN32 || defined __CYGWIN__ # define SCM_API __declspec(dllimport) extern #else # define SCM_API extern