mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-09-01 02:34:55 +00:00
stdalign: Ensure alignof is defined on FreeBSD (regression 2023-01-15).
* lib/stdalign.in.h: Include the system's <stdalign.h> when it exists. * m4/stdalign.m4 (gl_ALIGNASOF): Invoke gl_CHECK_NEXT_HEADERS. Set HAVE_STDALIGN_H. * modules/stdalign (Makefile.am): Substitute GUARD_PREFIX, HAVE_STDALIGN_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, PRAGMA_COLUMNS, NEXT_STDALIGN_H.
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
2023-01-27 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
stdalign: Ensure alignof is defined on FreeBSD (regression 2023-01-15).
|
||||
* lib/stdalign.in.h: Include the system's <stdalign.h> when it exists.
|
||||
* m4/stdalign.m4 (gl_ALIGNASOF): Invoke gl_CHECK_NEXT_HEADERS. Set
|
||||
HAVE_STDALIGN_H.
|
||||
* modules/stdalign (Makefile.am): Substitute GUARD_PREFIX,
|
||||
HAVE_STDALIGN_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, PRAGMA_COLUMNS,
|
||||
NEXT_STDALIGN_H.
|
||||
|
||||
2023-01-27 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
stddef: Fix test-stddef compilation error on FreeBSD 12/x86.
|
||||
|
||||
+18
-3
@@ -20,8 +20,22 @@
|
||||
/* Define two obsolescent C11 macros, assuming alignas and alignof are
|
||||
either keywords or alignasof-defined macros. */
|
||||
|
||||
#ifndef _GL_STDALIGN_H
|
||||
#define _GL_STDALIGN_H
|
||||
#ifndef _@GUARD_PREFIX@_STDALIGN_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* We need to include the system's <stdalign.h> when it exists, because it might
|
||||
define 'alignof' as a macro when it's not a keyword or compiler built-in. */
|
||||
#if @HAVE_STDALIGN_H@
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
# @INCLUDE_NEXT@ @NEXT_STDALIGN_H@
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_STDALIGN_H
|
||||
#define _@GUARD_PREFIX@_STDALIGN_H
|
||||
|
||||
#if (defined alignas \
|
||||
|| (defined __STDC_VERSION__ && 202311 <= __STDC_VERSION__) \
|
||||
@@ -31,4 +45,5 @@
|
||||
|
||||
#define __alignof_is_defined 1
|
||||
|
||||
#endif /* _GL_STDALIGN_H */
|
||||
#endif /* _@GUARD_PREFIX@_STDALIGN_H */
|
||||
#endif /* _@GUARD_PREFIX@_STDALIGN_H */
|
||||
|
||||
+12
-4
@@ -179,9 +179,17 @@ AC_DEFUN([gl_ALIGNASOF],
|
||||
AC_DEFUN([gl_STDALIGN_H],
|
||||
[
|
||||
AC_REQUIRE([gl_ALIGNASOF])
|
||||
GL_GENERATE_STDALIGN_H=false
|
||||
AS_IF([test "$gl_cv_header_working_stdalign_h" = no],
|
||||
[GL_GENERATE_STDALIGN_H=true])
|
||||
if test "$gl_cv_header_working_stdalign_h" = no; then
|
||||
GL_GENERATE_STDALIGN_H=true
|
||||
else
|
||||
GL_GENERATE_STDALIGN_H=false
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([stdalign.h])
|
||||
gl_CHECK_NEXT_HEADERS([stdalign.h])
|
||||
if test $ac_cv_header_stdalign_h = yes; then
|
||||
HAVE_STDALIGN_H=1
|
||||
else
|
||||
HAVE_STDALIGN_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_STDALIGN_H])
|
||||
])
|
||||
|
||||
+8
-1
@@ -26,7 +26,14 @@ BUILT_SOURCES += $(STDALIGN_H)
|
||||
if GL_GENERATE_STDALIGN_H
|
||||
stdalign.h: stdalign.in.h $(top_builddir)/config.status
|
||||
@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%'
|
||||
$(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
|
||||
$(gl_V_at)$(SED_HEADER_STDOUT) \
|
||||
-e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
|
||||
-e 's|@''HAVE_STDALIGN_H''@|$(HAVE_STDALIGN_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_STDALIGN_H''@|$(NEXT_STDALIGN_H)|g' \
|
||||
$(srcdir)/stdalign.in.h > $@-t
|
||||
$(AM_V_at)mv $@-t $@
|
||||
else
|
||||
stdalign.h: $(top_builddir)/config.status
|
||||
|
||||
Reference in New Issue
Block a user