summaryrefslogtreecommitdiff
path: root/ext/NDBM_File/NDBM_File.xs
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2008-11-03 23:40:11 +0100
committerH.Merijn Brand <h.m.brand@xs4all.nl>2008-11-06 20:18:08 +0000
commite74475c7f7d5be6b248e4c69480e5336325d067b (patch)
treec26bc9eec1d1bb6ca5c4115cf3b28f0e97abb993 /ext/NDBM_File/NDBM_File.xs
parent24d786f4d2806834028ce32abc1769da2e945f9b (diff)
downloadperl-e74475c7f7d5be6b248e4c69480e5336325d067b.tar.gz
Add prototype detection for NDBM header files
Message-ID: <20081103224011.26c223b3@r2d2> p4raw-id: //depot/perl@34756
Diffstat (limited to 'ext/NDBM_File/NDBM_File.xs')
-rw-r--r--ext/NDBM_File/NDBM_File.xs14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs
index 5e08330933..add9796ecf 100644
--- a/ext/NDBM_File/NDBM_File.xs
+++ b/ext/NDBM_File/NDBM_File.xs
@@ -1,12 +1,22 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#undef NDBM_HEADER_USES_PROTOTYPES
#if defined(I_GDBM_NDBM)
# include <gdbm-ndbm.h> /* Debian compatibility version */
+# ifdef GDBM_NDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#elif defined(I_GDBMNDBM)
# include <gdbm/ndbm.h> /* RedHat compatibility version */
+# ifdef GDBMNDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#elif defined(I_NDBM)
-#include <ndbm.h>
+# include <ndbm.h>
+# ifdef NDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#endif
typedef struct {
@@ -23,7 +33,7 @@ typedef datum datum_key ;
typedef datum datum_value ;
-#if defined(__cplusplus) && defined(HAS_GDBM)
+#if defined(__cplusplus) && !defined(NDBM_HEADER_USES_PROTOTYPES)
/* gdbm's header file used for compatibility with gdbm */
/* isn't compatible to C++ syntax, so we need these */
/* declarations to make everyone happy. */