+2023-09-16 Bruno Haible <bruno@clisp.org>
+
+ lib-symbol-visibility: Fix a misnomer.
+ * doc/lib-symbol-visibility.texi: Rename LIBFOO_DLL_EXPORTED to
+ LIBFOO_SHLIB_EXPORTED. Prefer the term "shared library", since the term
+ "DLL" applies only to Windows.
+ * lib/relocatable.h (RELOCATABLE_SHLIB_EXPORTED): Renamed from
+ RELOCATABLE_DLL_EXPORTED. Prefer the term "shared library", since the
+ term "DLL" applies only to Windows.
+ * lib/mbtowc-lock.c (SHLIB_EXPORTED): Renamed from DLL_EXPORTED.
+ * lib/nl_langinfo-lock.c (SHLIB_EXPORTED): Likewise.
+ * lib/setlocale-lock.c (SHLIB_EXPORTED): Likewise.
+
2023-09-15 Bruno Haible <bruno@clisp.org>
acl-permissions: Fix compilation error on Solaris 11 (regr. 2023-09-04).
Define a macro specific to your library like this.
@smallexample
#if HAVE_VISIBILITY && BUILDING_LIBFOO
-# define LIBFOO_DLL_EXPORTED __attribute__((__visibility__("default")))
+# define LIBFOO_SHLIB_EXPORTED __attribute__((__visibility__("default")))
#else
-# define LIBFOO_DLL_EXPORTED
+# define LIBFOO_SHLIB_EXPORTED
#endif
@end smallexample
This macro should be enabled in all public header files of your library.
@item
Annotate all variable, function and class declarations in all public header
-files of your library with @samp{LIBFOO_DLL_EXPORTED}. This annotation
+files of your library with @samp{LIBFOO_SHLIB_EXPORTED}. This annotation
can occur at different locations: between the @samp{extern} and the
type or return type, or just before the entity being declared, or after
the entire declarator. My preference is to put it right after @samp{extern},
the definition of the macro mentioned above, to something like this:
@smallexample
#if HAVE_VISIBILITY && BUILDING_LIBFOO
-# define LIBFOO_DLL_EXPORTED __attribute__((__visibility__("default")))
+# define LIBFOO_SHLIB_EXPORTED __attribute__((__visibility__("default")))
#elif (defined _WIN32 && !defined __CYGWIN__) && @@BUILDING_SHARED@@ && BUILDING_LIBFOO
# if defined DLL_EXPORT
-# define LIBFOO_DLL_EXPORTED __declspec(dllexport)
+# define LIBFOO_SHLIB_EXPORTED __declspec(dllexport)
# else
-# define LIBFOO_DLL_EXPORTED
+# define LIBFOO_SHLIB_EXPORTED
# endif
#elif (defined _WIN32 && !defined __CYGWIN__) && @@BUILDING_SHARED@@
-# define LIBFOO_DLL_EXPORTED __declspec(dllimport)
+# define LIBFOO_SHLIB_EXPORTED __declspec(dllimport)
#else
-# define LIBFOO_DLL_EXPORTED
+# define LIBFOO_SHLIB_EXPORTED
#endif
@end smallexample
@noindent
@noindent
And @code{DLL_EXPORT} is defined by Libtool, on Windows platforms, when
-compiling for a DLL. It is not defined when Libtool compiles an object
-file meant to be linked statically into some executable.
+compiling for a shared library (called DLL under Windows).
+It is not defined when Libtool compiles an object file meant to be linked
+statically into some executable.
/* Macro for exporting a symbol (function, not variable) defined in this file,
when compiled into a shared library. */
-# ifndef DLL_EXPORTED
+# ifndef SHLIB_EXPORTED
# if HAVE_VISIBILITY
/* Override the effect of the compiler option '-fvisibility=hidden'. */
-# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# define SHLIB_EXPORTED __attribute__((__visibility__("default")))
# elif defined _WIN32 || defined __CYGWIN__
-# define DLL_EXPORTED __declspec(dllexport)
+# define SHLIB_EXPORTED __declspec(dllexport)
# else
-# define DLL_EXPORTED
+# define SHLIB_EXPORTED
# endif
# endif
because the latter is not guaranteed to be a stable ABI in the future. */
/* Make sure the function gets exported from DLLs. */
-DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+SHLIB_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
static CRITICAL_SECTION lock;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
+SHLIB_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
/* Returns the internal lock used by mbrtowc and mbrtoc32. */
pthread_mutex_t *
}
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
+SHLIB_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
/* Returns the internal lock used by mbrtowc and mbrtoc32. */
mtx_t *
/* Macro for exporting a symbol (function, not variable) defined in this file,
when compiled into a shared library. */
-# ifndef DLL_EXPORTED
+# ifndef SHLIB_EXPORTED
# if HAVE_VISIBILITY
/* Override the effect of the compiler option '-fvisibility=hidden'. */
-# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# define SHLIB_EXPORTED __attribute__((__visibility__("default")))
# elif defined _WIN32 || defined __CYGWIN__
-# define DLL_EXPORTED __declspec(dllexport)
+# define SHLIB_EXPORTED __declspec(dllexport)
# else
-# define DLL_EXPORTED
+# define SHLIB_EXPORTED
# endif
# endif
because the latter is not guaranteed to be a stable ABI in the future. */
/* Make sure the function gets exported from DLLs. */
-DLL_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+SHLIB_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
static CRITICAL_SECTION lock;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+SHLIB_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
/* Returns the internal lock used by nl_langinfo. */
pthread_mutex_t *
}
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
+SHLIB_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
/* Returns the internal lock used by nl_langinfo. */
mtx_t *
/* This can be enabled through the configure --enable-relocatable option. */
#if ENABLE_RELOCATABLE
-/* When building a DLL, we must export some functions. Note that because
- this is a private .h file, we don't need to use __declspec(dllimport)
- in any case. */
+/* When building a shared library, we must export some functions.
+ Note that because this is a private .h file, we don't need to use
+ __declspec(dllimport) in any case. */
#if HAVE_VISIBILITY && BUILDING_DLL
-# define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default")))
+# define RELOCATABLE_SHLIB_EXPORTED __attribute__((__visibility__("default")))
#elif defined _MSC_VER && BUILDING_DLL
/* When building with MSVC, exporting a symbol means that the object file
contains a "linker directive" of the form /EXPORT:symbol. This can be
"dumpbin /directives FILE" commands.
The symbols from this file should be exported if and only if the object
file gets included in a DLL. Libtool, on Windows platforms, defines
- the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
- and does not define it when compiling an object file meant to be linked
- statically into some executable. */
+ the C macro DLL_EXPORT (together with PIC) when compiling for a shared
+ library (called DLL under Windows) and does not define it when compiling
+ an object file meant to be linked statically into some executable. */
# if defined DLL_EXPORT
-# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
+# define RELOCATABLE_SHLIB_EXPORTED __declspec(dllexport)
# else
-# define RELOCATABLE_DLL_EXPORTED
+# define RELOCATABLE_SHLIB_EXPORTED
# endif
#else
-# define RELOCATABLE_DLL_EXPORTED
+# define RELOCATABLE_SHLIB_EXPORTED
#endif
/* Sets the original and the current installation prefix of the package.
by the corresponding pathname with the current prefix instead. Both
prefixes should be directory names without trailing slash (i.e. use ""
instead of "/"). */
-extern RELOCATABLE_DLL_EXPORTED void
+extern RELOCATABLE_SHLIB_EXPORTED void
set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);
/* Macro for exporting a symbol (function, not variable) defined in this file,
when compiled into a shared library. */
-# ifndef DLL_EXPORTED
+# ifndef SHLIB_EXPORTED
# if HAVE_VISIBILITY
/* Override the effect of the compiler option '-fvisibility=hidden'. */
-# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# define SHLIB_EXPORTED __attribute__((__visibility__("default")))
# elif defined _WIN32 || defined __CYGWIN__
-# define DLL_EXPORTED __declspec(dllexport)
+# define SHLIB_EXPORTED __declspec(dllexport)
# else
-# define DLL_EXPORTED
+# define SHLIB_EXPORTED
# endif
# endif
because the latter is not guaranteed to be a stable ABI in the future. */
/* Make sure the function gets exported from DLLs. */
-DLL_EXPORTED CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+SHLIB_EXPORTED CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
static CRITICAL_SECTION lock;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED pthread_mutex_t *gl_get_setlocale_null_lock (void);
+SHLIB_EXPORTED pthread_mutex_t *gl_get_setlocale_null_lock (void);
/* Returns the internal lock used by setlocale_null_r. */
pthread_mutex_t *
}
/* Make sure the function gets exported from shared libraries. */
-DLL_EXPORTED mtx_t *gl_get_setlocale_null_lock (void);
+SHLIB_EXPORTED mtx_t *gl_get_setlocale_null_lock (void);
/* Returns the internal lock used by setlocale_null_r. */
mtx_t *