aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-11-27 02:18:25 +0000
committerdos-reis <gdr@axiomatics.org>2013-11-27 02:18:25 +0000
commitaf3d732a32928155d6bf8e6991f03d29002206db (patch)
treeb08fab1df0b87445d2cec5dfe3efd65202845d72
parent6775efcd28e0ff63a0a7e8ffc7474f0cd56fc6f2 (diff)
downloadopen-axiom-af3d732a32928155d6bf8e6991f03d29002206db.tar.gz
* include/storage.H (Arena<T>::allocate): Adjust spelling of
alignment query operator. (Arena<T>::Arena): Likewise. (HashTableEntry<T>): Adjust spelling of alignment specifier.
-rw-r--r--ChangeLog7
-rw-r--r--config/open-axiom.m410
-rw-r--r--config/openaxiom-c-macros.h.in12
-rwxr-xr-xconfigure8
-rw-r--r--src/ChangeLog7
-rw-r--r--src/include/storage.H6
-rw-r--r--src/utils/hash-table.H2
7 files changed, 35 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 979c0bb3..ee53416d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * config/open-axiom.m4 (OPENAXIOM_ALIGNMENT_OPERATOR): Define stub
+ with standard syntax.
+ (OPENAXIOM_ALIGNAS_SPECIFIER): Likewise.
+ * config/openaxiom-c-macros.h.in: Update.
+
2013-11-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
* configure.ac: Check for PowerShell on Windows platforms.
diff --git a/config/open-axiom.m4 b/config/open-axiom.m4
index da4dc75c..2218be2c 100644
--- a/config/open-axiom.m4
+++ b/config/open-axiom.m4
@@ -1054,8 +1054,9 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int a = alignof(int);]])],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int a = __alignof(int);]])],
[oa_alignment="__alignof"],
[AC_MSG_ERROR([C++ compiler does not support alignment query operator])])])
-AC_DEFINE_UNQUOTED([openaxiom_alignment],[$oa_alignment],
- [Alignment query operator])
+if test -n $oa_alignment -a $oa_alignment != "alignof"; then
+ AC_DEFINE_UNQUOTED([alignof],[$oa_alignment],[Alignment query operator])
+fi
AC_MSG_RESULT([$oa_alignment])
])
@@ -1072,8 +1073,9 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[alignas(16) int a = 42;]])],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[__attribute__((__aligned__(16))) int a = 42;]])],
[oa_alignas="__attribute__((__aligned__(N)))"],
[AC_MSG_ERROR([C++ compiler does not support alignment specifier])])])
-AC_DEFINE_UNQUOTED([openaxiom_alignas(N)],[$oa_alignas],
- [Alignment specifier operator])
+if test -n $oa_alignas -a $oa_alignas != "alignas"; then
+ AC_DEFINE_UNQUOTED([alignas(N)],[$oa_alignas],[Alignment specifier operator])
+fi
AC_MSG_RESULT([$oa_alignas])
])
diff --git a/config/openaxiom-c-macros.h.in b/config/openaxiom-c-macros.h.in
index 03b93dbe..6a93a786 100644
--- a/config/openaxiom-c-macros.h.in
+++ b/config/openaxiom-c-macros.h.in
@@ -262,6 +262,12 @@
#define below would cause a syntax error. */
#undef _UINT8_T
+/* Alignment specifier operator */
+#undef alignas
+
+/* Alignment query operator */
+#undef alignof
+
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
@@ -289,12 +295,6 @@
if such a type exists, and if the system does not define it. */
#undef intptr_t
-/* Alignment specifier operator */
-#undef openaxiom_alignas
-
-/* Alignment query operator */
-#undef openaxiom_alignment
-
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
diff --git a/configure b/configure
index dbee59aa..56499977 100755
--- a/configure
+++ b/configure
@@ -19945,11 +19945,13 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test -n $oa_alignment -a $oa_alignment != "alignof"; then
cat >>confdefs.h <<_ACEOF
-#define openaxiom_alignment $oa_alignment
+#define alignof $oa_alignment
_ACEOF
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $oa_alignment" >&5
$as_echo "$oa_alignment" >&6; }
@@ -19976,11 +19978,13 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test -n $oa_alignas -a $oa_alignas != "alignas"; then
cat >>confdefs.h <<_ACEOF
-#define openaxiom_alignas(N) $oa_alignas
+#define alignas(N) $oa_alignas
_ACEOF
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $oa_alignas" >&5
$as_echo "$oa_alignas" >&6; }
diff --git a/src/ChangeLog b/src/ChangeLog
index c0c25a74..5e1f75ba 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * include/storage.H (Arena<T>::allocate): Adjust spelling of
+ alignment query operator.
+ (Arena<T>::Arena): Likewise.
+ (HashTableEntry<T>): Adjust spelling of alignment specifier.
+
2013-11-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* include/Charset.H (OpenAxiom): New.
diff --git a/src/include/storage.H b/src/include/storage.H
index afd5f51f..e414dec2 100644
--- a/src/include/storage.H
+++ b/src/include/storage.H
@@ -229,8 +229,7 @@ namespace OpenAxiom {
if (BlockStorage::room(store) < sz) {
// Not enough room left. Make sure we allocate storage
// at least as big as the current.
- Handle* h = acquire(std::max(n, object_count(store)),
- openaxiom_alignment(T));
+ Handle* h = acquire(std::max(n, object_count(store)), alignof(T));
previous(h) = store;
store = h;
}
@@ -239,8 +238,7 @@ namespace OpenAxiom {
template<typename T>
Arena<T>::Arena(size_t n)
- : store(BlockStorage::acquire(n * sizeof (T),
- openaxiom_alignment (T)))
+ : store(BlockStorage::acquire(n * sizeof (T), alignof (T)))
{ }
template<typename T>
diff --git a/src/utils/hash-table.H b/src/utils/hash-table.H
index 6d9da3d7..d74c7760 100644
--- a/src/utils/hash-table.H
+++ b/src/utils/hash-table.H
@@ -49,7 +49,7 @@ namespace OpenAxiom {
// so that an instance of it can be used directly as a VM value.
// See <open-axiom/vm> for more description.
template<typename T>
- struct openaxiom_alignas(8) HashTableEntry : T {
+ struct alignas(8) HashTableEntry : T {
HashTableEntry* chain; // previous item in the same bucket chain
size_t hash; // hash code of stored data
};