1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-07 20:23:50 +03:00

r14844: Support a stdbool.h replacement in lib/replace/

This commit is contained in:
Jelmer Vernooij
2006-03-31 23:28:18 +00:00
committed by Gerald (Jerry) Carter
parent eb63d83f00
commit bccfddcafa
10 changed files with 29 additions and 17 deletions

View File

@@ -15,8 +15,6 @@ AC_C_BIGENDIAN
AC_HEADER_STDC
AC_CHECK_HEADERS(stdbool.h)
AC_CHECK_SIZEOF(short,cross)
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
@@ -27,5 +25,3 @@ fi
if test $ac_cv_sizeof_long_long -lt 8;then
AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
fi
AC_CHECK_TYPE(_Bool)

View File

@@ -58,7 +58,7 @@ AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/i
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h)
AC_CHECK_HEADERS(sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(fnmatch.h pwd.h sys/termio.h sys/time.h sys/statfs.h sys/statvfs.h stdarg.h)
AC_CHECK_HEADERS(stdint.h inttypes.h locale.h shadow.h)
AC_CHECK_HEADERS(locale.h shadow.h)
AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h)
AC_CHECK_HEADERS(sys/capability.h sys/acl.h)

View File

@@ -195,7 +195,7 @@ void set_arg_val(const char * name, ...)
arg->arg_val.nval = va_arg(ap, uint64_t);
break;
case ARG_BOOL:
arg->arg_val.bval = va_arg(ap, BOOL);
arg->arg_val.bval = va_arg(ap, int);
break;
case ARG_PATHNAME:
arg->arg_val.pval = va_arg(ap, char *);

View File

@@ -26,11 +26,10 @@
#include "libcli/util/nt_status.h"
typedef int BOOL;
#define False (0)
#define True (1)
#define Auto (2)
typedef int BOOL;
/* used to hold an arbitrary blob of data */
typedef struct datablob {

View File

@@ -74,14 +74,6 @@ _PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE;
#include <stddef.h>
#include <sys/time.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif

View File

@@ -185,8 +185,10 @@ typedef char* MprStr;
#ifndef __cplusplus
typedef unsigned char uchar;
#ifndef __bool_true_false_are_defined
typedef int bool;
#endif
#endif
/*
* Porters: put other operating system type defines here

View File

@@ -52,6 +52,7 @@ getpass
readline (the library)
Types:
bool
socklen_t
u_int{8,16,32}_t
uint_t

View File

@@ -1,3 +1,4 @@
AC_CHECK_HEADERS([stdint.h inttypes.h])
AC_CHECK_TYPE(uint_t, unsigned int)
AC_CHECK_TYPE(int8_t, signed char)
AC_CHECK_TYPE(uint8_t, unsigned char)
@@ -127,5 +128,7 @@ LIBS="$SAVE_LIBS"
AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
[AC_MSG_ERROR([Required function not found])])
AC_CHECK_HEADERS(stdbool.h)
sinclude(lib/replace/readline.m4)
sinclude(lib/replace/getpass.m4)

View File

@@ -35,6 +35,14 @@
#define QSORT_CAST (int (*)(const void *, const void *))
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(i) sys_errlist[i]
@@ -194,4 +202,13 @@ int rep_mkstemp(char *temp);
#define INT32_MAX _TYPE_MAXIMUM(int32_t)
#endif
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#else
#define __bool_true_false_are_defined
typedef bool int;
#define false (0)
#define true (1)
#endif
#endif

View File

@@ -41,6 +41,8 @@ struct param_section {
struct param_context;
struct smbsrv_connection;
#define Auto (2)
#include "param/proto.h"
#endif /* _PARAM_H */