Mercurial > hg > xemacs-beta
diff src/database.c @ 5119:d877c14318b3 ben-lisp-object
merge in latest-fix changes
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:22:48 -0600 |
parents | e0db3c197671 c12b646d84ee |
children | d1247f3cc363 |
line wrap: on
line diff
--- a/src/database.c Sat Dec 26 21:18:49 2009 -0600 +++ b/src/database.c Sat Dec 26 21:22:48 2009 -0600 @@ -85,7 +85,47 @@ #endif /* HAVE_BERKELEY_DB */ #ifdef HAVE_DBM +#if defined (CYGWIN) || defined (MINGW) + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +/* As of Cygwin 1.7.0, the prototypes in ndbm.h are broken when compiling +using C++, since they are of the form `datum dbm_firstkey()', without any +args given. */ +/* Parameters to dbm_store for simple insertion or replacement. */ +#define DBM_INSERT 0 +#define DBM_REPLACE 1 + + +/* The data and key structure. This structure is defined for compatibility. */ +typedef struct { + char *dptr; + int dsize; + } datum; + + +/* The file information header. This is good enough for most applications. */ +typedef struct {int dummy[10];} DBM; + +int dbm_clearerr(DBM *); +void dbm_close(DBM *); +int dbm_delete(DBM *, datum); +int dbm_error(DBM *); +datum dbm_fetch(DBM *, datum); +datum dbm_firstkey(DBM *); +datum dbm_nextkey(DBM *); +DBM *dbm_open(const char *, int, mode_t); +int dbm_store(DBM *, datum, datum, int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#else #include NDBM_H_FILE +#endif Lisp_Object Qdbm; #endif /* HAVE_DBM */