3838#define HAVE_ERRNO_AS_DEFINE
3939#endif /* __CYGWIN__ */
4040
41+ /* Macros to make switching between C and C++ mode easier */
42+ #ifdef __cplusplus
43+ #define C_MODE_START extern "C" {
44+ #define C_MODE_END }
45+ #else
46+ #define C_MODE_START
47+ #define C_MODE_END
48+ #endif
4149
4250#if defined(_WIN32 ) || defined(_WIN64 ) || defined(__WIN32__ ) || defined(WIN32 )
4351#include <config-win.h>
121129/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */
122130#define ulonglong2double (A ) my_ulonglong2double(A)
123131#define my_off_t2double (A ) my_ulonglong2double(A)
124- #ifdef __cplusplus
125- extern "C" {
126- #endif
132+ C_MODE_START
127133double my_ulonglong2double (unsigned long long A );
128- #ifdef __cplusplus
129- }
130- #endif
134+ C_MODE_END
131135#endif /* _AIX */
132136
133137#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
@@ -385,7 +389,9 @@ typedef int my_socket; /* File descriptor for sockets */
385389#endif
386390/* Type for fuctions that handles signals */
387391#define sig_handler RETSIGTYPE
392+ C_MODE_START
388393typedef void (* sig_return )();/* Returns type from signal */
394+ C_MODE_END
389395#if defined(__GNUC__ ) && !defined(_lint )
390396typedef char pchar ; /* Mixed prototypes can take char */
391397typedef char puchar ; /* Mixed prototypes can take char */
@@ -399,8 +405,10 @@ typedef int pbool; /* Mixed prototypes can't take char */
399405typedef int pshort ; /* Mixed prototypes can't take short int */
400406typedef double pfloat ; /* Mixed prototypes can't take float */
401407#endif
408+ C_MODE_START
402409typedef int (* qsort_cmp )(const void * ,const void * );
403410typedef int (* qsort_cmp2 )(void * , const void * ,const void * );
411+ C_MODE_END
404412#ifdef HAVE_mit_thread
405413#define qsort_t void
406414#undef QSORT_TYPE_IS_VOID
@@ -1038,13 +1046,4 @@ typedef union {
10381046#define statistic_add (V ,C ,L ) (V)+=(C)
10391047#endif
10401048
1041- /* Macros to make switching between C and C++ mode easier */
1042- #ifdef __cplusplus
1043- #define C_MODE_START extern "C" {
1044- #define C_MODE_END }
1045- #else
1046- #define C_MODE_START
1047- #define C_MODE_END
1048- #endif
1049-
1050- #endif /* _global_h */
1049+ #endif /* my_global_h */
0 commit comments