From f0c95cf7b4a9b952324605fdcae103b5e2070429 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 1 Jul 2024 15:28:34 +0100 Subject: [PATCH] Declare exported global variables to be extern, following example in libtool docs. --- include/libfmapi.h.in | 30 +++++++++++++++--------------- include/libfmapi/extern.h | 6 ++++-- libfmapi/libfmapi_extern.h | 8 +------- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/include/libfmapi.h.in b/include/libfmapi.h.in index e677a28..a86411e 100644 --- a/include/libfmapi.h.in +++ b/include/libfmapi.h.in @@ -311,49 +311,49 @@ int libfmapi_one_off_entry_identifier_get_utf16_email_address( * MAPI class identifiers * ------------------------------------------------------------------------- */ -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_mapi[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_public_strings[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_internet_headers[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_appointment[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_task[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_address[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_common[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_journal[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_sticky_note[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_sharing[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_rss_feed[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_unified_messaging[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_calendar[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_air_sync[ 16 ]; -LIBFMAPI_EXTERN \ +LIBFMAPI_EXTERN_VARIABLE \ uint8_t libfmapi_class_identifier_attachment[ 16 ]; /* ------------------------------------------------------------------------- diff --git a/include/libfmapi/extern.h b/include/libfmapi/extern.h index 8333fa1..4d63842 100644 --- a/include/libfmapi/extern.h +++ b/include/libfmapi/extern.h @@ -33,12 +33,14 @@ #define LIBFMAPI_EXTERN __declspec(dllexport) #elif defined( LIBFMAPI_DLL_IMPORT ) -#define LIBFMAPI_EXTERN extern __declspec(dllimport) +#define LIBFMAPI_EXTERN __declspec(dllimport) #else -#define LIBFMAPI_EXTERN extern +#define LIBFMAPI_EXTERN #endif +#define LIBFMAPI_EXTERN_VARIABLE extern LIBFMAPI_EXTERN + #endif /* !defined( _LIBFMAPI_EXTERN_H ) */ diff --git a/libfmapi/libfmapi_extern.h b/libfmapi/libfmapi_extern.h index ea7344f..9561c84 100644 --- a/libfmapi/libfmapi_extern.h +++ b/libfmapi/libfmapi_extern.h @@ -30,14 +30,8 @@ #include -#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) -#define LIBFMAPI_EXTERN_VARIABLE extern -#else -#define LIBFMAPI_EXTERN_VARIABLE LIBFMAPI_EXTERN -#endif - #else -#define LIBFMAPI_EXTERN /* extern */ +#define LIBFMAPI_EXTERN #define LIBFMAPI_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBFMAPI ) */