From da8ca4227032f9683d35b89f68997b6ee58ef430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Fri, 16 Jul 2021 17:29:40 +0200 Subject: [PATCH] tdb: Fix invalid syntax in tdb.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit aacd3ecb45ab04cb2f8a38a385a45bdca6d88cd2) --- lib/tdb/include/tdb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 * -- 2.31.1