File 0001-tdb-Fix-invalid-syntax-in-tdb.h.patch of Package tdb

From aacd3ecb45ab04cb2f8a38a385a45bdca6d88cd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
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
<lslebodn@redhat.com>.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14762

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
---
 lib/tdb/include/tdb.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/tdb.h b/include/tdb.h
index 696547c8cd9..884171c73d9 100644
--- a/include/tdb.h
+++ b/include/tdb.h
@@ -33,6 +33,19 @@ extern "C" {
 #include <signal.h>
 #include <stdbool.h>
 
+/* 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.33.0

openSUSE Build Service is sponsored by