}
#endif
-#ifdef HAVE_C99_BOOL
-#define BOOL_TYPE _Bool
-#else
-#define BOOL_TYPE char
-#undef SIZEOF__BOOL
-#define SIZEOF__BOOL 1
-#endif
-
static PyObject *
bool_set(void *ptr, PyObject *value, Py_ssize_t size)
{
case -1:
return NULL;
case 0:
- *(BOOL_TYPE *)ptr = 0;
+ *(_Bool *)ptr = 0;
_RET(value);
default:
- *(BOOL_TYPE *)ptr = 1;
+ *(_Bool *)ptr = 1;
_RET(value);
}
}
static PyObject *
bool_get(void *ptr, Py_ssize_t size)
{
- return PyBool_FromLong((long)*(BOOL_TYPE *)ptr);
+ return PyBool_FromLong((long)*(_Bool *)ptr);
}
static PyObject *
typedef struct { char c; double x; } st_double;
typedef struct { char c; void *x; } st_void_p;
typedef struct { char c; size_t x; } st_size_t;
+typedef struct { char c; _Bool x; } st_bool;
#define SHORT_ALIGN (sizeof(st_short) - sizeof(short))
#define INT_ALIGN (sizeof(st_int) - sizeof(int))
#define DOUBLE_ALIGN (sizeof(st_double) - sizeof(double))
#define VOID_P_ALIGN (sizeof(st_void_p) - sizeof(void *))
#define SIZE_T_ALIGN (sizeof(st_size_t) - sizeof(size_t))
+#define BOOL_ALIGN (sizeof(st_bool) - sizeof(_Bool))
/* We can't support q and Q in native mode unless the compiler does;
in std mode, they're 8 bytes on all platforms. */
typedef struct { char c; long long x; } s_long_long;
#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(long long))
-#ifdef HAVE_C99_BOOL
-#define BOOL_TYPE _Bool
-typedef struct { char c; _Bool x; } s_bool;
-#define BOOL_ALIGN (sizeof(s_bool) - sizeof(BOOL_TYPE))
-#else
-#define BOOL_TYPE char
-#define BOOL_ALIGN 0
-#endif
-
#ifdef __powerc
#pragma options align=reset
#endif
static PyObject *
nu_bool(const char *p, const formatdef *f)
{
- BOOL_TYPE x;
+ _Bool x;
memcpy((char *)&x, p, sizeof x);
return PyBool_FromLong(x != 0);
}
np_bool(char *p, PyObject *v, const formatdef *f)
{
int y;
- BOOL_TYPE x;
+ _Bool x;
y = PyObject_IsTrue(v);
if (y < 0)
return -1;
{'N', sizeof(size_t), SIZE_T_ALIGN, nu_size_t, np_size_t},
{'q', sizeof(long long), LONG_LONG_ALIGN, nu_longlong, np_longlong},
{'Q', sizeof(long long), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
- {'?', sizeof(BOOL_TYPE), BOOL_ALIGN, nu_bool, np_bool},
+ {'?', sizeof(_Bool), BOOL_ALIGN, nu_bool, np_bool},
{'e', sizeof(short), SHORT_ALIGN, nu_halffloat, np_halffloat},
{'f', sizeof(float), FLOAT_ALIGN, nu_float, np_float},
{'d', sizeof(double), DOUBLE_ALIGN, nu_double, np_double},
case 'n': case 'N': size = sizeof(Py_ssize_t); break;
case 'f': size = sizeof(float); break;
case 'd': size = sizeof(double); break;
- #ifdef HAVE_C99_BOOL
case '?': size = sizeof(_Bool); break;
- #else
- case '?': size = sizeof(char); break;
- #endif
case 'P': size = sizeof(void *); break;
}
case 'N': RETURN("N");
case 'f': RETURN("f");
case 'd': RETURN("d");
- #ifdef HAVE_C99_BOOL
case '?': RETURN("?");
- #else
- case '?': RETURN("?");
- #endif
case 'P': RETURN("P");
}
case 'l': UNPACK_SINGLE(ld, ptr, long); goto convert_ld;
/* boolean */
- #ifdef HAVE_C99_BOOL
case '?': UNPACK_SINGLE(ld, ptr, _Bool); goto convert_bool;
- #else
- case '?': UNPACK_SINGLE(ld, ptr, char); goto convert_bool;
- #endif
/* unsigned integers */
case 'H': UNPACK_SINGLE(lu, ptr, unsigned short); goto convert_lu;
ld = PyObject_IsTrue(item);
if (ld < 0)
return -1; /* preserve original error */
- #ifdef HAVE_C99_BOOL
PACK_SINGLE(ptr, ld, _Bool);
- #else
- PACK_SINGLE(ptr, ld, char);
- #endif
break;
/* bytes object */
case 'l': CMP_SINGLE(p, q, long); return equal;
/* boolean */
- #ifdef HAVE_C99_BOOL
case '?': CMP_SINGLE(p, q, _Bool); return equal;
- #else
- case '?': CMP_SINGLE(p, q, char); return equal;
- #endif
/* unsigned integers */
case 'H': CMP_SINGLE(p, q, unsigned short); return equal;
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Bool support" >&5
-$as_echo_n "checking for _Bool support... " >&6; }
-have_c99_bool=no
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-_Bool x; x = (_Bool)0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define HAVE_C99_BOOL 1" >>confdefs.h
-
- have_c99_bool=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_c99_bool" >&5
-$as_echo "$have_c99_bool" >&6; }
-if test "$have_c99_bool" = yes ; then
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
_ACEOF
-fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
AC_CHECK_SIZEOF(long double, 16)
fi
-
-AC_MSG_CHECKING(for _Bool support)
-have_c99_bool=no
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
- AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
- have_c99_bool=yes
-],[])
-AC_MSG_RESULT($have_c99_bool)
-if test "$have_c99_bool" = yes ; then
AC_CHECK_SIZEOF(_Bool, 1)
-fi
AC_CHECK_SIZEOF(off_t, [], [
#ifdef HAVE_SYS_TYPES_H
/* Has builtin atomics */
#undef HAVE_BUILTIN_ATOMIC
-/* Define this if you have the type _Bool. */
-#undef HAVE_C99_BOOL
-
/* Define to 1 if you have the 'chflags' function. */
#undef HAVE_CHFLAGS