libxbps: hide compat symbols.

This commit is contained in:
Juan RP 2012-06-18 09:52:19 +02:00
parent ad766cd538
commit 0f3d4f4a19
6 changed files with 20 additions and 19 deletions

View File

@ -3,21 +3,22 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdarg.h> #include <stdarg.h>
#include "xbps_api_impl.h"
#ifndef HAVE_STRLCAT #ifndef HAVE_STRLCAT
size_t strlcat(char *, const char *, size_t); size_t HIDDEN strlcat(char *, const char *, size_t);
#endif #endif
#ifndef HAVE_STRLCPY #ifndef HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t); size_t HIDDEN strlcpy(char *, const char *, size_t);
#endif #endif
#ifndef HAVE_STRCASESTR #ifndef HAVE_STRCASESTR
char *strcasestr(const char *, const char *); char HIDDEN *strcasestr(const char *, const char *);
#endif #endif
#if defined(HAVE_VASPRINTF) && !defined(_GNU_SOURCE) #if defined(HAVE_VASPRINTF) && !defined(_GNU_SOURCE)
int vasprintf(char **, const char *, va_list); int HIDDEN vasprintf(char **, const char *, va_list);
#endif #endif
#endif /* COMPAT_H */ #endif /* COMPAT_H */

View File

@ -29,6 +29,17 @@
#include <assert.h> #include <assert.h>
#include <xbps_api.h> #include <xbps_api.h>
/*
* By default all public functions have default visibility, unless
* visibility has been detected by configure and the HIDDEN definition
* is used.
*/
#if HAVE_VISIBILITY
#define HIDDEN __attribute__ ((visibility("hidden")))
#else
#define HIDDEN
#endif
#include "compat.h" #include "compat.h"
#include "queue.h" #include "queue.h"
#include "fetch.h" #include "fetch.h"
@ -45,17 +56,6 @@
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif #endif
/*
* By default all public functions have default visibility, unless
* visibility has been detected by configure and the HIDDEN definition
* is used.
*/
#if HAVE_VISIBILITY
#define HIDDEN __attribute__ ((visibility("hidden")))
#else
#define HIDDEN
#endif
__BEGIN_DECLS __BEGIN_DECLS
/** /**

View File

@ -40,7 +40,7 @@
/* /*
* Find the first occurrence of find in s, ignore case. * Find the first occurrence of find in s, ignore case.
*/ */
char * char HIDDEN *
strcasestr(const char *s, const char *find) strcasestr(const char *s, const char *find)
{ {
char c, sc; char c, sc;

View File

@ -28,7 +28,7 @@
* Returns strlen(src) + MIN(siz, strlen(initial dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred. * If retval >= siz, truncation occurred.
*/ */
size_t size_t HIDDEN
strlcat(char *dst, const char *src, size_t siz) strlcat(char *dst, const char *src, size_t siz)
{ {
char *d = dst; char *d = dst;

View File

@ -26,7 +26,7 @@
* will be copied. Always NUL terminates (unless siz == 0). * will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred. * Returns strlen(src); if retval >= siz, truncation occurred.
*/ */
size_t size_t HIDDEN
strlcpy(char *dst, const char *src, size_t siz) strlcpy(char *dst, const char *src, size_t siz)
{ {
char *d = dst; char *d = dst;

View File

@ -33,7 +33,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
int int HIDDEN
vasprintf(char **ret, const char *fmt, va_list ap) vasprintf(char **ret, const char *fmt, va_list ap)
{ {
char *buf, *new_buf; char *buf, *new_buf;