+
+
+
+
fi
-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Generic support in compiler" >&5
printf %s "checking for _Generic support in compiler... " >&6; }
if test ${ax_cv_cc_c11_generic+y}
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if size_t == uint64_t" >&5
+printf %s "checking if size_t == uint64_t... " >&6; }
+if test ${ax_cv_cc_size_same_as_uint64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+
+ if test "$cross_compiling" = yes
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <stdint.h>
+ #include <stddef.h>
+
+ int main(int argc, char **argv) {
+ return _Generic((size_t)(0), uint64_t: 1, default: 0);
+ }
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ax_cv_cc_size_same_as_uint64=no
+else $as_nop
+ ax_cv_cc_size_same_as_uint64=yes
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_size_same_as_uint64" >&5
+printf "%s\n" "$ax_cv_cc_size_same_as_uint64" >&6; }
+if test "x$ax_cv_cc_size_same_as_uint64" = "xyes"; then
+
+printf "%s\n" "#define SIZE_SAME_AS_UINT64 1" >>confdefs.h
+
+fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ssize_t == int64_t" >&5
+printf %s "checking if ssize_t == int64_t... " >&6; }
+if test ${ax_cv_cc_ssize_same_as_int64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+
+ if test "$cross_compiling" = yes
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <stdint.h>
+ #include <stddef.h>
+
+ int main(int argc, char **argv) {
+ return _Generic((ssize_t)(0), int64_t: 1, default: 0);
+ }
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ax_cv_cc_ssize_same_as_int64=no
+else $as_nop
+ ax_cv_cc_ssize_same_as_int64=yes
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_ssize_same_as_int64" >&5
+printf "%s\n" "$ax_cv_cc_ssize_same_as_int64" >&6; }
+if test "x$ax_cv_cc_ssize_same_as_int64" = "xyes"; then
+
+printf "%s\n" "#define SSIZE_SAME_AS_INT64 1" >>confdefs.h
+
+fi
+
+
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
printf %s "checking for crypt in -lcrypt... " >&6; }
if test ${ac_cv_lib_crypt_crypt+y}
AX_CC_BUILTIN_TYPES_COMPATIBLE_P
AX_CC_BUILTIN_BSWAP64
AX_CC_BUILTIN_CLZLL
-
AX_CC_HAVE_C11_GENERIC
if test "x$ax_cv_cc_c11_generic" != "xyes"; then
AC_MSG_ERROR([FreeRADIUS requires support for the C11 _Generic keyword])
fi
+AX_CC_SIZE_SAME_AS_UINT64
+AX_CC_SSIZE_SAME_AS_INT64
+
dnl #############################################################
dnl #
dnl # 7. Checks for library functions
fi
])
+dnl #
+dnl # Check if size_t and int64_t are identical
+dnl #
+AC_DEFUN([AX_CC_SIZE_SAME_AS_UINT64],
+[
+AC_CACHE_CHECK([if size_t == uint64_t], [ax_cv_cc_size_same_as_uint64],[
+ AC_RUN_IFELSE(
+ [
+ AC_LANG_SOURCE([
+ #include <stdint.h>
+ #include <stddef.h>
+
+ int main(int argc, char **argv) {
+ return _Generic((size_t)(0), uint64_t: 1, default: 0);
+ }
+ ])
+ ],
+ [ax_cv_cc_size_same_as_uint64=no],
+ [ax_cv_cc_size_same_as_uint64=yes]
+ )
+])
+if test "x$ax_cv_cc_size_same_as_uint64" = "xyes"; then
+ AC_DEFINE([SIZE_SAME_AS_UINT64],1,[Define if the compiler supports size_t has the same underlying type as uint64])
+fi
+])
+
+dnl #
+dnl # Check if ssize_t and int64_t are identical
+dnl #
+AC_DEFUN([AX_CC_SSIZE_SAME_AS_INT64],
+[
+AC_CACHE_CHECK([if ssize_t == int64_t], [ax_cv_cc_ssize_same_as_int64],[
+ AC_RUN_IFELSE(
+ [
+ AC_LANG_SOURCE([
+ #include <stdint.h>
+ #include <stddef.h>
+
+ int main(int argc, char **argv) {
+ return _Generic((ssize_t)(0), int64_t: 1, default: 0);
+ }
+ ])
+ ],
+ [ax_cv_cc_ssize_same_as_int64=no],
+ [ax_cv_cc_ssize_same_as_int64=yes]
+ )
+])
+if test "x$ax_cv_cc_ssize_same_as_int64" = "xyes"; then
+ AC_DEFINE([SSIZE_SAME_AS_INT64],1,[Define if the compiler supports ssize_t has the same underlying type as int64])
+fi
+])
+
dnl #
dnl # Determine the number of system cores we have
dnl #
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
+/* Define if the compiler supports size_t has the same underlying type as
+ uint64 */
+#undef SIZE_SAME_AS_UINT64
+
/* Solaris-Style ctime_r */
#undef SOLARISSTYLE
/* Define to 1 if you have the ANSI C header files. */
+/* Define if the compiler supports ssize_t has the same underlying type as
+ int64 */
+#undef SSIZE_SAME_AS_INT64
#undef STDC_HEADERS
/* SYSV-Style get*byaddr_r */
fr_slen_t fr_sbuff_out_uint32(fr_sbuff_parse_error_t *err, uint32_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint64(fr_sbuff_parse_error_t *err, uint64_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_size(fr_sbuff_parse_error_t *err, size_t *out, fr_sbuff_t *sbuff, bool no_trailing);
+fr_slen_t fr_sbuff_out_ssize(fr_sbuff_parse_error_t *err, ssize_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint8_oct(fr_sbuff_parse_error_t *err, uint8_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint16_oct(fr_sbuff_parse_error_t *err, uint16_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint32_oct(fr_sbuff_parse_error_t *err, uint32_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint64_oct(fr_sbuff_parse_error_t *err, uint64_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_size_oct(fr_sbuff_parse_error_t *err, size_t *out, fr_sbuff_t *sbuff, bool no_trailing);
+fr_slen_t fr_sbuff_out_ssize_oct(fr_sbuff_parse_error_t *err, ssize_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint8_hex(fr_sbuff_parse_error_t *err, uint8_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint16_hex(fr_sbuff_parse_error_t *err, uint16_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint32_hex(fr_sbuff_parse_error_t *err, uint32_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_uint64_hex(fr_sbuff_parse_error_t *err, uint64_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_size_hex(fr_sbuff_parse_error_t *err, size_t *out, fr_sbuff_t *sbuff, bool no_trailing);
+fr_slen_t fr_sbuff_out_ssize_hex(fr_sbuff_parse_error_t *err, ssize_t *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_float32(fr_sbuff_parse_error_t *err, float *out, fr_sbuff_t *sbuff, bool no_trailing);
fr_slen_t fr_sbuff_out_float64(fr_sbuff_parse_error_t *err, double *out, fr_sbuff_t *sbuff, bool no_trailing);
+#ifndef SIZE_SAME_AS_UINT64
+# define _fr_sbuff_out_size(_err, _out, _in) size_t * : fr_sbuff_out_size(_err, (size_t *)_out, _in, true),
+#else
+# define _fr_sbuff_out_size(_err, _out, _in)
+#endif
+
+#ifndef SSIZE_SAME_AS_INT64
+# define _fr_sbuff_out_ssize(_err, _out, _in) ssize_t * : fr_sbuff_out_ssize(err, (ssize_t *)_out, _in, true),
+#else
+# define _fr_sbuff_out_ssize(_err, _out, _in)
+#endif
+
/** Parse a value based on the output type
*
* @param[out] _err If not NULL a value describing the parse error
uint16_t * : fr_sbuff_out_uint16(_err, (uint16_t *)_out, _in, true), \
uint32_t * : fr_sbuff_out_uint32(_err, (uint32_t *)_out, _in, true), \
uint64_t * : fr_sbuff_out_uint64(_err, (uint64_t *)_out, _in, true), \
- size_t * : fr_sbuff_out_size(_err, (size_t *)_out, _in, true), \
+ _fr_sbuff_out_size(_err, _out, _in) \
+ _fr_sbuff_out_ssize(_err, _out, _in) \
float * : fr_sbuff_out_float32(_err, (float *)_out, _in, true), \
double * : fr_sbuff_out_float64(_err, (double *)_out, _in, true) \
)