1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Use Gnulib's `alignof' module.

* m4/gnulib-cache.m4: Use `alignof'.

* libguile/objcodes.c (scm_c_make_objcode_slice): Use `alignof_type'.
This commit is contained in:
Ludovic Courtès 2009-11-15 20:53:21 +01:00
parent 3452e6667f
commit 1119e49368
3 changed files with 6 additions and 5 deletions

View file

@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program. # the same distribution terms as the rest of that program.
# #
# Generated by gnulib-tool. # Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects

View file

@ -27,6 +27,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <alignof.h>
#include "_scm.h" #include "_scm.h"
#include "vm-bootstrap.h" #include "vm-bootstrap.h"
@ -119,11 +120,10 @@ scm_c_make_objcode_slice (SCM parent, const scm_t_uint8 *ptr)
scm_from_uint32 (parent_data->len), scm_from_uint32 (parent_data->len),
scm_from_uint32 (parent_data->metalen))); scm_from_uint32 (parent_data->metalen)));
#ifdef __GNUC__ /* we need `__alignof__' */
/* Make sure bytecode for the objcode-meta is suitable aligned. Failing to /* Make sure bytecode for the objcode-meta is suitable aligned. Failing to
do so leads to SIGBUS/SIGSEGV on some arches (e.g., SPARC). */ do so leads to SIGBUS/SIGSEGV on some arches (e.g., SPARC). */
assert ((((scm_t_bits) ptr) & (__alignof__ (struct scm_objcode) - 1UL)) == 0); assert ((((scm_t_bits) ptr) &
#endif (alignof_type (struct scm_objcode) - 1UL)) == 0);
data = (struct scm_objcode*)ptr; data = (struct scm_objcode*)ptr;
if (data->base + data->len + data->metalen > parent_data->base + parent_data->len + parent_data->metalen) if (data->base + data->len + data->metalen > parent_data->base + parent_data->len + parent_data->metalen)

View file

@ -15,11 +15,12 @@
# Specification in the form of a command-line invocation: # Specification in the form of a command-line invocation:
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf # gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
# Specification in the form of a few gnulib-tool.m4 macro invocations: # Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([]) gl_LOCAL_DIR([])
gl_MODULES([ gl_MODULES([
alignof
alloca-opt alloca-opt
autobuild autobuild
byteswap byteswap