update.
[chise/xemacs-chise.git.1] / src / database.c
index 57e3925..2edbee4 100644 (file)
@@ -43,16 +43,30 @@ Boston, MA 02111-1307, USA.  */
 /* glibc 2.1 doesn't have this problem with DB 2.x */
 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
 #ifdef HAVE_INTTYPES_H
+#ifndef __BIT_TYPES_DEFINED__
 #define __BIT_TYPES_DEFINED__
+#endif
 #include <inttypes.h>
+#if !HAVE_U_INT8_T
 typedef uint8_t  u_int8_t;
+#endif
+#if !HAVE_U_INT16_T
 typedef uint16_t u_int16_t;
+#endif
+#if !HAVE_U_INT32_T
 typedef uint32_t u_int32_t;
+#endif
 #ifdef WE_DONT_NEED_QUADS
+#if !HAVE_U_INT64_T
 typedef uint64_t u_int64_t;
+#endif
 #endif /* WE_DONT_NEED_QUADS */
 #endif /* HAVE_INTTYPES_H */
 #endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
+/* Berkeley DB wants __STDC__ to be defined; else if does `#define const' */
+#if ! defined (__STDC__) && ! defined(__cplusplus)
+#define __STDC__ 0
+#endif
 #include DB_H_FILE              /* Berkeley db's header file */
 #ifndef DB_VERSION_MAJOR
 # define DB_VERSION_MAJOR 1
@@ -695,8 +709,9 @@ and defaults to 0755.
       status = dbase->open (dbase, filename, NULL,
                             real_subtype, accessmask, modemask);
 #else /* DB_VERSION >= 4.1 */
+      /* DB_AUTO_COMMIT requires transaction support, don't try it */
       status = dbase->open (dbase, NULL, filename, NULL, real_subtype,
-                           accessmask | DB_AUTO_COMMIT, modemask);
+                           accessmask, modemask);
 #endif /* DB_VERSION < 4.1 */
       if (status)
         {
@@ -777,7 +792,7 @@ If there is no corresponding value, return DEFAULT (defaults to nil).
   }
 }
 
-DEFUN ("map-database", Fmapdatabase, 2, 2, 0, /*
+DEFUN ("map-database", Fmap_database, 2, 2, 0, /*
 Map FUNCTION over entries in DATABASE, calling it with two args,
 each key and value in the database.
 */
@@ -812,7 +827,7 @@ syms_of_database (void)
 
   DEFSUBR (Fopen_database);
   DEFSUBR (Fdatabasep);
-  DEFSUBR (Fmapdatabase);
+  DEFSUBR (Fmap_database);
   DEFSUBR (Fput_database);
   DEFSUBR (Fget_database);
   DEFSUBR (Fremove_database);