mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-20 07:49:27 +08:00
mdbx: define & use bool type for C API.
Change-Id: Icb6cd635a4813bfc92d31bdc527414bdddce4a63
This commit is contained in:
@@ -6408,7 +6408,7 @@ int mdbx_txn_begin(MDBX_env *env, MDBX_txn *parent, unsigned flags,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int mdbx_txn_info(const MDBX_txn *txn, MDBX_txn_info *info, int scan_rlt) {
|
||||
int mdbx_txn_info(const MDBX_txn *txn, MDBX_txn_info *info, bool scan_rlt) {
|
||||
int rc = check_txn(txn, MDBX_TXN_BLOCKED - MDBX_TXN_HAS_CHILD);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
return rc;
|
||||
@@ -16842,14 +16842,11 @@ static int mdbx_drop0(MDBX_cursor *mc, int subs) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, int del) {
|
||||
int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del) {
|
||||
int rc = check_txn_rw(txn, MDBX_TXN_BLOCKED);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
return rc;
|
||||
|
||||
if (unlikely(1 < (unsigned)del))
|
||||
return MDBX_EINVAL;
|
||||
|
||||
if (unlikely(!mdbx_txn_dbi_exists(txn, dbi, DBI_USRVALID)))
|
||||
return MDBX_EINVAL;
|
||||
|
||||
|
12
src/defs.h
12
src/defs.h
@@ -89,18 +89,6 @@
|
||||
# endif
|
||||
#endif /* __extern_C */
|
||||
|
||||
#ifndef __cplusplus
|
||||
# ifndef bool
|
||||
# define bool _Bool
|
||||
# endif
|
||||
# ifndef true
|
||||
# define true (1)
|
||||
# endif
|
||||
# ifndef false
|
||||
# define false (0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(nullptr) && !defined(__cplusplus) || (__cplusplus < 201103L && !defined(_MSC_VER))
|
||||
# define nullptr NULL
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user