File: hide-internal-symbols.patch

package info (click to toggle)
libdvbpsi 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 3,632 kB
  • sloc: ansic: 19,087; makefile: 252; xml: 100; sh: 93
file content (47 lines) | stat: -rw-r--r-- 1,834 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: Hide internal symbols
Author: Sebastian Ramacher <sramacher@debian.org>
Last-Update: 2015-03-22

--- libdvbpsi-1.2.0.orig/src/dvbpsi_private.h
+++ libdvbpsi-1.2.0/src/dvbpsi_private.h
@@ -32,6 +32,14 @@
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
+#ifndef HIDDEN
+# if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
+#  define HIDDEN __attribute__((visibility("hidden")))
+# else
+#  define HIDDEN
+# endif
+#endif
+
 /*****************************************************************************
  * Error management
  *
@@ -40,7 +48,7 @@
  *****************************************************************************/
 
 #ifdef HAVE_VARIADIC_MACROS
-void dvbpsi_message(dvbpsi_t *dvbpsi, const int level, const char *fmt, ...);
+HIDDEN void dvbpsi_message(dvbpsi_t *dvbpsi, const int level, const char *fmt, ...);
 
 #  define dvbpsi_error(hnd, src, str, x...)                             \
         dvbpsi_message(hnd, DVBPSI_MSG_ERROR, "libdvbpsi error (%s): " str, src, ##x)
@@ -49,11 +57,13 @@ void dvbpsi_message(dvbpsi_t *dvbpsi, co
 #  define dvbpsi_debug(hnd, src, str, x...)                                  \
         dvbpsi_message(hnd, DVBPSI_MSG_DEBUG, "libdvbpsi debug (%s): " str, src, ##x)
 #else
-void dvbpsi_error(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
-void dvbpsi_warning(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
-void dvbpsi_debug(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
+HIDDEN void dvbpsi_error(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
+HIDDEN void dvbpsi_warning(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
+HIDDEN void dvbpsi_debug(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
 #endif
 
+#undef HIDDEN
+
 #else
 #error "Multiple inclusions of dvbpsi_private.h"
 #endif