From: Günther Deschner Date: Fri, 16 Jul 2021 15:29:40 +0000 (+0200) Subject: tdb: Fix invalid syntax in tdb.h X-Git-Tag: tdb-1.4.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aacd3ecb45ab04cb2f8a38a385a45bdca6d88cd2;p=thirdparty%2Fsamba.git tdb: Fix invalid syntax in tdb.h Defining _PUBLIC_ in the same way as in talloc.h resolves an issue with a previous fix for Solaris Studio compiler 12.4 that prefixed all calls in tdb.h with _PUBLIC_. Thanks to Lukas Slebodnik . Bug: https://bugzilla.samba.org/show_bug.cgi?id=14762 Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher --- diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 696547c8cd9..884171c73d9 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -33,6 +33,19 @@ extern "C" { #include #include +/* for old gcc releases that don't have the feature test macro __has_attribute */ +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + +#ifndef _PUBLIC_ +#if __has_attribute(visibility) +#define _PUBLIC_ __attribute__((visibility("default"))) +#else +#define _PUBLIC_ +#endif +#endif + /** * @defgroup tdb The tdb API *