diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-11-03 23:40:11 +0100 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2008-11-06 20:18:08 +0000 |
commit | e74475c7f7d5be6b248e4c69480e5336325d067b (patch) | |
tree | c26bc9eec1d1bb6ca5c4115cf3b28f0e97abb993 /ext/NDBM_File | |
parent | 24d786f4d2806834028ce32abc1769da2e945f9b (diff) | |
download | perl-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')
-rw-r--r-- | ext/NDBM_File/Makefile.PL | 9 | ||||
-rw-r--r-- | ext/NDBM_File/NDBM_File.xs | 14 |
2 files changed, 12 insertions, 11 deletions
diff --git a/ext/NDBM_File/Makefile.PL b/ext/NDBM_File/Makefile.PL index dc5cc447fb..7b586017d7 100644 --- a/ext/NDBM_File/Makefile.PL +++ b/ext/NDBM_File/Makefile.PL @@ -1,16 +1,7 @@ -use Config; use ExtUtils::MakeMaker; - -my $define = ""; - -if($Config{i_gdbm} && $Config{i_gdbm} eq 'define') { - $define .= " -DHAS_GDBM"; -} - WriteMakefile( NAME => 'NDBM_File', LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"], - DEFINE => $define, MAN3PODS => {}, # Pods will be built by installman. XSPROTOARG => '-noprototypes', # XXX remove later? VERSION_FROM => 'NDBM_File.pm', 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. */ |