1
0
Эх сурвалжийг харах

Export C symbols properly

Bryan Drewery 11 жил өмнө
parent
commit
1d565c05ed

+ 6 - 0
src/compat/compat.h

@@ -24,9 +24,15 @@
 #include "strsep.h"
 #include "strsep.h"
 #include "timespec.h"
 #include "timespec.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #ifndef HAVE_MEMMEM
 #ifndef HAVE_MEMMEM
 void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
 void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
 #endif
 #endif
+#ifdef __cplusplus
+}
+#endif
 
 
 /* These apparently are unsafe without recasting. */
 /* These apparently are unsafe without recasting. */
 #define egg_isdigit(x)  isdigit((int)  (unsigned char) (x))
 #define egg_isdigit(x)  isdigit((int)  (unsigned char) (x))

+ 7 - 1
src/compat/dirname.h

@@ -7,6 +7,12 @@
 
 
 #define dirname my_dirname
 #define dirname my_dirname
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 char *dirname(const char *);
 char *dirname(const char *);
-#endif /* !_DIRNAME_H */
+#ifdef __cplusplus
+}
+#endif
 
 
+#endif /* !_DIRNAME_H */

+ 6 - 0
src/compat/dn_expand.h

@@ -5,7 +5,13 @@
 #  include "config.h"
 #  include "config.h"
 #endif
 #endif
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 int my_dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
 int my_dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
+#ifdef __cplusplus
+}
+#endif
 
 
 #endif /* !_DN_EXPAND_H */
 #endif /* !_DN_EXPAND_H */
 
 

+ 6 - 0
src/compat/inet_ntop.h

@@ -16,8 +16,14 @@
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #ifndef HAVE_INET_NTOP
 #ifndef HAVE_INET_NTOP
 const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
 const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #endif
 #endif
+#ifdef __cplusplus
+}
+#endif
 
 
 #endif /* !_EGG_COMPAT_INET_NTOP_H */
 #endif /* !_EGG_COMPAT_INET_NTOP_H */

+ 6 - 0
src/compat/memcpy.h

@@ -13,9 +13,15 @@
 
 
 #include <string.h>
 #include <string.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #ifndef HAVE_MEMCPY
 #ifndef HAVE_MEMCPY
 /* Use our own implementation. */
 /* Use our own implementation. */
 void *memcpy(void *dest, const void *src, size_t n);
 void *memcpy(void *dest, const void *src, size_t n);
 #endif
 #endif
+#ifdef __cplusplus
+}
+#endif
 
 
 #endif	/* !__EGG_COMPAT_MEMCPY_H */
 #endif	/* !__EGG_COMPAT_MEMCPY_H */

+ 6 - 0
src/compat/memset.h

@@ -13,10 +13,16 @@
 
 
 #include <string.h>
 #include <string.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #ifndef HAVE_MEMSET
 #ifndef HAVE_MEMSET
 /* Use our own implementation. */
 /* Use our own implementation. */
 void *memset(void *dest, int c, size_t n);
 void *memset(void *dest, int c, size_t n);
 #endif
 #endif
+#ifdef __cplusplus
+}
+#endif
 
 
 /* Use memset instead of bzero.
 /* Use memset instead of bzero.
  */
  */

+ 0 - 1
src/compat/memutil.c

@@ -1,7 +1,6 @@
 #include <string.h>
 #include <string.h>
 #include "memcpy.h"
 #include "memcpy.h"
 #include "memutil.h"
 #include "memutil.h"
-#include "src/main.h"
 #include <stdlib.h>
 #include <stdlib.h>
 
 
 
 

+ 8 - 2
src/compat/memutil.h

@@ -17,12 +17,18 @@
 //#define calloc my_calloc
 //#define calloc my_calloc
 //#define realloc my_realloc
 //#define realloc my_realloc
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void str_redup(char **, const char *);
 void str_redup(char **, const char *);
 char *strdup(const char *);
 char *strdup(const char *);
 char *strldup(const char *, size_t);
 char *strldup(const char *, size_t);
-
-
 void *my_calloc(size_t, size_t);
 void *my_calloc(size_t, size_t);
 void *my_realloc(void *, size_t);
 void *my_realloc(void *, size_t);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !_MEMUTIL_H */
 #endif /* !_MEMUTIL_H */

+ 6 - 0
src/compat/snprintf.h

@@ -23,6 +23,9 @@
 #  endif
 #  endif
 #endif
 #endif
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* Use the system libraries version of vsnprintf() if available. Otherwise
 /* Use the system libraries version of vsnprintf() if available. Otherwise
  * use our own.
  * use our own.
  */
  */
@@ -45,4 +48,7 @@ int egg_snprintf();
 #  define egg_snprintf	snprintf
 #  define egg_snprintf	snprintf
 #endif
 #endif
 
 
+#ifdef __cplusplus
+}
+#endif
 #endif	/* !_EGG_COMPAT_SNPRINTF_H_ */
 #endif	/* !_EGG_COMPAT_SNPRINTF_H_ */

+ 6 - 0
src/compat/strcasecmp.h

@@ -14,6 +14,9 @@
 #include <ctype.h>
 #include <ctype.h>
 
 
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #ifndef HAVE_STRCASECMP
 #ifndef HAVE_STRCASECMP
 /* Use our own implementation. */
 /* Use our own implementation. */
 int strcasecmp(const char *, const char *);
 int strcasecmp(const char *, const char *);
@@ -24,4 +27,7 @@ int strcasecmp(const char *, const char *);
 int strncasecmp(const char *, const char *, size_t);
 int strncasecmp(const char *, const char *, size_t);
 #endif
 #endif
 
 
+#ifdef __cplusplus
+}
+#endif
 #endif	/* !__EGG_COMPAT_STRCASECMP_H */
 #endif	/* !__EGG_COMPAT_STRCASECMP_H */

+ 6 - 0
src/compat/strftime.h

@@ -13,6 +13,9 @@
 
 
 #include <time.h>
 #include <time.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* Use the system libraries version of strftime() if available. Otherwise
 /* Use the system libraries version of strftime() if available. Otherwise
  * use our own.
  * use our own.
  */
  */
@@ -20,4 +23,7 @@
 size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *tp);
 size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *tp);
 #endif
 #endif
 
 
+#ifdef __cplusplus
+}
+#endif
 #endif	/* !_EGG_COMPAT_STRFTIME_H_ */
 #endif	/* !_EGG_COMPAT_STRFTIME_H_ */

+ 6 - 1
src/compat/strlcpy.h

@@ -13,8 +13,13 @@
 #define strlcpy my_strlcpy
 #define strlcpy my_strlcpy
 #define strlcat my_strlcat
 #define strlcat my_strlcat
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 size_t strlcpy(char *, const char *, size_t);
 size_t strlcpy(char *, const char *, size_t);
 size_t strlcat(char *, const char *, size_t);
 size_t strlcat(char *, const char *, size_t);
 
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* !_STRLCPY_H */
 #endif /* !_STRLCPY_H */
-

+ 6 - 1
src/compat/strsep.h

@@ -9,7 +9,12 @@
 
 
 #define strsep my_strsep
 #define strsep my_strsep
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 char *strsep(char **, const char *);
 char *strsep(char **, const char *);
 
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* !_STRSEP_H */
 #endif /* !_STRSEP_H */
-