mirror of
https://github.com/samba-team/samba.git
synced 2025-12-10 04:23:50 +03:00
r14844: Support a stdbool.h replacement in lib/replace/
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
eb63d83f00
commit
bccfddcafa
@@ -15,8 +15,6 @@ AC_C_BIGENDIAN
|
|||||||
|
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
|
||||||
AC_CHECK_HEADERS(stdbool.h)
|
|
||||||
|
|
||||||
AC_CHECK_SIZEOF(short,cross)
|
AC_CHECK_SIZEOF(short,cross)
|
||||||
AC_CHECK_SIZEOF(int,cross)
|
AC_CHECK_SIZEOF(int,cross)
|
||||||
AC_CHECK_SIZEOF(long,cross)
|
AC_CHECK_SIZEOF(long,cross)
|
||||||
@@ -27,5 +25,3 @@ fi
|
|||||||
if test $ac_cv_sizeof_long_long -lt 8;then
|
if test $ac_cv_sizeof_long_long -lt 8;then
|
||||||
AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
|
AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
|
||||||
fi
|
fi
|
||||||
AC_CHECK_TYPE(_Bool)
|
|
||||||
|
|
||||||
|
|||||||
@@ -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/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(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(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(nss.h nss_common.h ns_api.h sys/security.h)
|
||||||
AC_CHECK_HEADERS(sys/capability.h sys/acl.h)
|
AC_CHECK_HEADERS(sys/capability.h sys/acl.h)
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ void set_arg_val(const char * name, ...)
|
|||||||
arg->arg_val.nval = va_arg(ap, uint64_t);
|
arg->arg_val.nval = va_arg(ap, uint64_t);
|
||||||
break;
|
break;
|
||||||
case ARG_BOOL:
|
case ARG_BOOL:
|
||||||
arg->arg_val.bval = va_arg(ap, BOOL);
|
arg->arg_val.bval = va_arg(ap, int);
|
||||||
break;
|
break;
|
||||||
case ARG_PATHNAME:
|
case ARG_PATHNAME:
|
||||||
arg->arg_val.pval = va_arg(ap, char *);
|
arg->arg_val.pval = va_arg(ap, char *);
|
||||||
|
|||||||
@@ -26,11 +26,10 @@
|
|||||||
|
|
||||||
#include "libcli/util/nt_status.h"
|
#include "libcli/util/nt_status.h"
|
||||||
|
|
||||||
|
typedef int BOOL;
|
||||||
|
|
||||||
#define False (0)
|
#define False (0)
|
||||||
#define True (1)
|
#define True (1)
|
||||||
#define Auto (2)
|
|
||||||
|
|
||||||
typedef int BOOL;
|
|
||||||
|
|
||||||
/* used to hold an arbitrary blob of data */
|
/* used to hold an arbitrary blob of data */
|
||||||
typedef struct datablob {
|
typedef struct datablob {
|
||||||
|
|||||||
@@ -74,14 +74,6 @@ _PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE;
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/time.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
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -185,8 +185,10 @@ typedef char* MprStr;
|
|||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
typedef unsigned char uchar;
|
typedef unsigned char uchar;
|
||||||
|
#ifndef __bool_true_false_are_defined
|
||||||
typedef int bool;
|
typedef int bool;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Porters: put other operating system type defines here
|
* Porters: put other operating system type defines here
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ getpass
|
|||||||
readline (the library)
|
readline (the library)
|
||||||
|
|
||||||
Types:
|
Types:
|
||||||
|
bool
|
||||||
socklen_t
|
socklen_t
|
||||||
u_int{8,16,32}_t
|
u_int{8,16,32}_t
|
||||||
uint_t
|
uint_t
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
AC_CHECK_HEADERS([stdint.h inttypes.h])
|
||||||
AC_CHECK_TYPE(uint_t, unsigned int)
|
AC_CHECK_TYPE(uint_t, unsigned int)
|
||||||
AC_CHECK_TYPE(int8_t, signed char)
|
AC_CHECK_TYPE(int8_t, signed char)
|
||||||
AC_CHECK_TYPE(uint8_t, unsigned 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_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
|
||||||
[AC_MSG_ERROR([Required function not found])])
|
[AC_MSG_ERROR([Required function not found])])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(stdbool.h)
|
||||||
|
|
||||||
sinclude(lib/replace/readline.m4)
|
sinclude(lib/replace/readline.m4)
|
||||||
sinclude(lib/replace/getpass.m4)
|
sinclude(lib/replace/getpass.m4)
|
||||||
|
|||||||
@@ -35,6 +35,14 @@
|
|||||||
#define QSORT_CAST (int (*)(const void *, const void *))
|
#define QSORT_CAST (int (*)(const void *, const void *))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRERROR
|
#ifndef HAVE_STRERROR
|
||||||
extern char *sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
#define strerror(i) sys_errlist[i]
|
#define strerror(i) sys_errlist[i]
|
||||||
@@ -194,4 +202,13 @@ int rep_mkstemp(char *temp);
|
|||||||
#define INT32_MAX _TYPE_MAXIMUM(int32_t)
|
#define INT32_MAX _TYPE_MAXIMUM(int32_t)
|
||||||
#endif
|
#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
|
#endif
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ struct param_section {
|
|||||||
struct param_context;
|
struct param_context;
|
||||||
struct smbsrv_connection;
|
struct smbsrv_connection;
|
||||||
|
|
||||||
|
#define Auto (2)
|
||||||
|
|
||||||
#include "param/proto.h"
|
#include "param/proto.h"
|
||||||
|
|
||||||
#endif /* _PARAM_H */
|
#endif /* _PARAM_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user