+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',
typedef datum datum_key ;
typedef datum datum_value ;
+
+#if defined(_cplusplus) && defined(HAS_GDBM)
+/* gdbm's header file used for compatibility with gdbm */
+/* isn't compatible to C++ syntax, so we need these */
+/* declarations to make everyone happy. */
+EXTERN_C DBM *dbm_open(const char *, int, mode_t);
+EXTERN_C void dbm_close(DBM *);
+EXTERN_C datum dbm_fetch(DBM *, datum);
+EXTERN_C int dbm_store(DBM *, datum, datum, int);
+EXTERN_C int dbm_delete(DBM *, datum);
+EXTERN_C datum dbm_firstkey(DBM *);
+EXTERN_C datum dbm_nextkey(DBM *);
+#endif
+
MODULE = NDBM_File PACKAGE = NDBM_File PREFIX = ndbm_
NDBM_File