From ea2ea538c6a308bfc1ca17142ad3e272f5758e80 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 24 Aug 2010 14:42:22 +0000 Subject: Implement an s-expression C++ library. * utils/hash-table.H: New. * utils/sexpr.H: Likewise. * utils/sexpr.cc: Likewise. * utils/string-pool.H: Likewise. * utils/string-pool.cc: Likewise. * utils/storage.H: Include openaxiom-c-macros.h (Memory::Storage): New. (Memory::Arena): Likewise. * utils/storage.cc: Implement member functions of new class. * utils/Makefile.in (libOpenAxiom_HEADERS): Include hash-table.H, string-pool.H, and sexpr.H (libOpenAxiom_SOURCES): Include string-pool.cc and sexpr.cc --- config/open-axiom.m4 | 20 ++++++++++++++++++++ config/openaxiom-c-macros.h.in | 3 +++ 2 files changed, 23 insertions(+) (limited to 'config') diff --git a/config/open-axiom.m4 b/config/open-axiom.m4 index a2e26e8b..d7de600a 100644 --- a/config/open-axiom.m4 +++ b/config/open-axiom.m4 @@ -1010,10 +1010,30 @@ if test x"$ac_cv_header_sys_mman_h" = xyes; then fi ]) +dnl ---------------------------------- +dnl -- OPENAXIOM_ALIGNMENT_OPERATOR -- +dnl ---------------------------------- +dnl Check that the C/C++ compiler understand +dnl alignment operator, i.e. either `alignof', +dnl or vendor lock-ins such as `__alignof'. +AC_DEFUN([OPENAXIOM_ALIGNMENT_OPERATOR],[ +AC_MSG_CHECKING([name of alignment query operator]) +oa_alignment= +AC_COMPILE_IFELSE([int a = __alignof(int);], + [oa_alignment="__alignof"], + [AC_COMPILE_IFELSE([int a = alignof(int);], + [oa_alignment="alignof"], + [AC_MSG_ERROR([C/C++ compiler does not support alignment query operator])])]) +AC_DEFINE_UNQUOTED([openaxiom_alignment],[$oa_alignment], + [Alignment query operator]) +AC_MSG_RESULT([$oa_alignment]) +]) + dnl -------------------------- dnl -- OPENAXIOM_CHECK_MISC -- dnl -------------------------- AC_DEFUN([OPENAXIOM_CHECK_MISC],[ +OPENAXIOM_ALIGNMENT_OPERATOR case $GCC in yes) CFLAGS="$CFLAGS -O2 -Wall" diff --git a/config/openaxiom-c-macros.h.in b/config/openaxiom-c-macros.h.in index c92cc8ac..41b47835 100644 --- a/config/openaxiom-c-macros.h.in +++ b/config/openaxiom-c-macros.h.in @@ -207,6 +207,9 @@ if such a type exists, and if the system does not define it. */ #undef intptr_t +/* Alignment query operator */ +#undef openaxiom_alignment + /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t -- cgit v1.2.3