forked from GitHub/gf-core
the code in the C runtime is now complete independent from config.h
This commit is contained in:
@@ -34,10 +34,6 @@ AM_PROG_CC_C_O
|
|||||||
-Wno-unused-value"
|
-Wno-unused-value"
|
||||||
fi]
|
fi]
|
||||||
|
|
||||||
|
|
||||||
AC_C_ALIGNOF
|
|
||||||
AC_C_FAM_IN_MEM
|
|
||||||
|
|
||||||
case "$target_cpu" in
|
case "$target_cpu" in
|
||||||
i?86) cpu=i386; AC_DEFINE(LIGHTNING_I386, 1,
|
i?86) cpu=i386; AC_DEFINE(LIGHTNING_I386, 1,
|
||||||
[Define if lightning is targeting the x86 architecture]) ;;
|
[Define if lightning is targeting the x86 architecture]) ;;
|
||||||
|
|||||||
@@ -56,13 +56,9 @@
|
|||||||
|
|
||||||
#ifdef GU_ALIGNOF
|
#ifdef GU_ALIGNOF
|
||||||
# define gu_alignof GU_ALIGNOF
|
# define gu_alignof GU_ALIGNOF
|
||||||
# define GU_ALIGNOF_WORKS_ON_FAM_STRUCTS
|
|
||||||
#else
|
#else
|
||||||
# define gu_alignof(t_) \
|
# define gu_alignof(t_) \
|
||||||
((size_t)(offsetof(struct { char c_; t_ e_; }, e_)))
|
((size_t)(offsetof(struct { char c_; t_ e_; }, e_)))
|
||||||
# ifdef GU_CAN_HAVE_FAM_IN_MEMBER
|
|
||||||
# define GU_ALIGNOF_WORKS_ON_FAM_STRUCTS
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GU_PLIT(type, expr) \
|
#define GU_PLIT(type, expr) \
|
||||||
@@ -116,7 +112,7 @@ gu_min(int a, int b) {
|
|||||||
return GU_MIN(a, b);
|
return GU_MIN(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GU_ALIGNOF_WORKS_ON_FAM_STRUCTS
|
#ifdef GU_ALIGNOF
|
||||||
#define gu_flex_alignof gu_alignof
|
#define gu_flex_alignof gu_alignof
|
||||||
#else
|
#else
|
||||||
#define gu_flex_alignof(t) 0
|
#define gu_flex_alignof(t) 0
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
# AC_C_ALIGNOF
|
|
||||||
# ------------
|
|
||||||
# Check whether the C compiler supports the alignof(type) operator
|
|
||||||
AC_DEFUN([AC_C_ALIGNOF],
|
|
||||||
[
|
|
||||||
AC_CACHE_CHECK([for alignof],ac_cv_c_alignof,
|
|
||||||
[ac_cv_c_alignof=no
|
|
||||||
for ac_kw in alignof __alignof __alignof__; do
|
|
||||||
AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([], [int align = $ac_kw (int);])],
|
|
||||||
[ac_cv_c_alignof=$ac_kw; break])
|
|
||||||
done])
|
|
||||||
if test $ac_cv_c_alignof != no; then
|
|
||||||
AC_DEFINE([HAVE_ALIGNOF], 1,
|
|
||||||
[Define to 1 if alignof works on your compiler])
|
|
||||||
if test $ac_cv_c_alignof != alignof; then
|
|
||||||
AC_DEFINE_UNQUOTED([alignof], [$ac_cv_c_alignof],
|
|
||||||
[Define to the name of the alignof operator.])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_C_FAM_IN_MEM
|
|
||||||
# ---------------
|
|
||||||
# Check whether the C compiler supports a flexible array member
|
|
||||||
# in a struct that is the (last) member of a struct
|
|
||||||
AC_DEFUN([AC_C_FAM_IN_MEM],
|
|
||||||
[
|
|
||||||
AC_CACHE_CHECK([for flexible array members in struct members],
|
|
||||||
ac_cv_c_fam_in_mem,
|
|
||||||
[AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([
|
|
||||||
struct { struct { char foo[]; } bar; } baz;
|
|
||||||
])],
|
|
||||||
[ac_cv_c_fam_in_mem=yes],
|
|
||||||
[ac_cv_c_fam_in_mem=no])])
|
|
||||||
if test $ac_cv_c_fam_in_mem = yes; then
|
|
||||||
AC_DEFINE([CAN_HAVE_FAM_IN_MEMBER], 1,
|
|
||||||
[Define to 1 if a struct with flexible array members can be
|
|
||||||
the last member of another struct.])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
Reference in New Issue
Block a user