From 059f63c9a4a53db690f7f13ebdece6280dcdd95f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 5 Oct 2024 12:00:05 +0300 Subject: [PATCH] Guard against direct include of internal headers from outside (refactoring) * src/atomic_ops.h b/src/atomic_ops.h (AO_ATOMIC_OPS_INCLUDED): Define macro (at the end of file). * src/atomic_ops/ao_version.h [AO_ATOMIC_OPS_INCLUDED]: Issue a preprocessor error (as as if AO_ATOMIC_OPS_H is not defined). * src/atomic_ops/generalize.h [AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/emul_cas.h [AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/generalize-arithm.h: Regenerate. * src/atomic_ops/generalize-small.h: Likewise. * src/atomic_ops/sysdeps/ao_t_is_int.h: Likewise. * src/atomic_ops/sysdeps/gcc/generic-arithm.h: Likewise. * src/atomic_ops/sysdeps/gcc/generic-small.h: Likewise. * src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h: Likewise. * src/atomic_ops/sysdeps/loadstore/atomic_load.h: Likewise. * src/atomic_ops/sysdeps/loadstore/atomic_store.h: Likewise. * src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h: Likewise. * src/atomic_ops/sysdeps/loadstore/char_atomic_load.h: Likewise. * src/atomic_ops/sysdeps/loadstore/char_atomic_store.h: Likewise. * src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h: Likewise. * src/atomic_ops/sysdeps/loadstore/int_atomic_load.h: Likewise. * src/atomic_ops/sysdeps/loadstore/int_atomic_store.h: Likewise. * src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h: Likewise. * src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h: Likewise. * src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h: Likewise. * src/atomic_ops/sysdeps/loadstore/short_atomic_load.h: Likewise. * src/atomic_ops/sysdeps/loadstore/short_atomic_store.h: Likewise. * src/atomic_ops/generalize-arithm.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Issue a preprocessor error (that the file is for internal usage only). * src/atomic_ops/generalize-small.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/all_acquire_release_volatile.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/all_atomic_load_store.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/all_atomic_only_load.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/ao_t_is_int.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/armcc/arm_v6.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/aarch64. [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/alpha.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/arm.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/avr32.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/cris.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/e2k.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/generic-arithm.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/generic-small.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/generic.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/hexagon.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/hppa.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/ia64.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/m68k.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/mips.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/powerpc.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/riscv.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/s390.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/sh.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/sparc.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/tile.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/gcc/x86.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/generic_pthread.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/hpc/hppa.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/hpc/ia64.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/ibmc/powerpc.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/icc/ia64.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/atomic_load.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/atomic_store.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/ordered_loads_only.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/loadstore/ordered_stores_only.template [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/msftc/arm.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/msftc/arm64.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/msftc/common32_defs.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/msftc/x86.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/msftc/x86_64.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/ordered.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/ordered_except_wr.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/read_ordered.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/sunc/sparc.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/sunc/x86.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/test_and_set_t_is_char.h [!AO_ATOMIC_OPS_H || AO_ATOMIC_OPS_INCLUDED]: Likewise. * src/atomic_ops/sysdeps/standard_ao_double_t.h [!AO_ATOMIC_OPS_H || AO_HAVE_double_t]: Issue a preprocessor error. --- src/atomic_ops.h | 1 + src/atomic_ops/ao_version.h | 2 +- src/atomic_ops/generalize-arithm.h | 16 ++++ src/atomic_ops/generalize-arithm.template | 4 + src/atomic_ops/generalize-small.h | 20 ++++ src/atomic_ops/generalize-small.template | 4 + src/atomic_ops/generalize.h | 8 +- .../sysdeps/all_acquire_release_volatile.h | 4 + .../sysdeps/all_aligned_atomic_load_store.h | 4 + .../sysdeps/all_atomic_load_store.h | 4 + src/atomic_ops/sysdeps/all_atomic_only_load.h | 4 + src/atomic_ops/sysdeps/ao_t_is_int.h | 24 +++++ src/atomic_ops/sysdeps/ao_t_is_int.template | 4 + src/atomic_ops/sysdeps/armcc/arm_v6.h | 4 + src/atomic_ops/sysdeps/emul_cas.h | 8 +- src/atomic_ops/sysdeps/gcc/aarch64.h | 5 +- src/atomic_ops/sysdeps/gcc/alpha.h | 6 +- src/atomic_ops/sysdeps/gcc/arm.h | 5 +- src/atomic_ops/sysdeps/gcc/avr32.h | 5 +- src/atomic_ops/sysdeps/gcc/cris.h | 4 + src/atomic_ops/sysdeps/gcc/e2k.h | 4 + src/atomic_ops/sysdeps/gcc/generic-arithm.h | 96 ++++++++++++------- .../sysdeps/gcc/generic-arithm.template | 6 +- src/atomic_ops/sysdeps/gcc/generic-small.h | 24 +++-- .../sysdeps/gcc/generic-small.template | 6 +- src/atomic_ops/sysdeps/gcc/generic.h | 5 +- src/atomic_ops/sysdeps/gcc/hexagon.h | 4 + src/atomic_ops/sysdeps/gcc/hppa.h | 4 + src/atomic_ops/sysdeps/gcc/ia64.h | 4 + src/atomic_ops/sysdeps/gcc/m68k.h | 6 +- src/atomic_ops/sysdeps/gcc/mips.h | 4 + src/atomic_ops/sysdeps/gcc/powerpc.h | 6 +- src/atomic_ops/sysdeps/gcc/riscv.h | 4 + src/atomic_ops/sysdeps/gcc/s390.h | 6 +- src/atomic_ops/sysdeps/gcc/sh.h | 5 +- src/atomic_ops/sysdeps/gcc/sparc.h | 6 +- src/atomic_ops/sysdeps/gcc/tile.h | 4 + src/atomic_ops/sysdeps/gcc/x86.h | 4 + src/atomic_ops/sysdeps/generic_pthread.h | 4 + src/atomic_ops/sysdeps/hpc/hppa.h | 4 + src/atomic_ops/sysdeps/hpc/ia64.h | 4 + src/atomic_ops/sysdeps/ibmc/powerpc.h | 4 + src/atomic_ops/sysdeps/icc/ia64.h | 4 + .../loadstore/acquire_release_volatile.h | 4 + .../acquire_release_volatile.template | 4 + .../sysdeps/loadstore/atomic_load.h | 4 + .../sysdeps/loadstore/atomic_load.template | 4 + .../sysdeps/loadstore/atomic_store.h | 4 + .../sysdeps/loadstore/atomic_store.template | 4 + .../loadstore/char_acquire_release_volatile.h | 4 + .../sysdeps/loadstore/char_atomic_load.h | 4 + .../sysdeps/loadstore/char_atomic_store.h | 4 + .../loadstore/double_atomic_load_store.h | 4 + .../loadstore/int_acquire_release_volatile.h | 4 + .../sysdeps/loadstore/int_atomic_load.h | 4 + .../sysdeps/loadstore/int_atomic_store.h | 4 + .../sysdeps/loadstore/ordered_loads_only.h | 20 ++++ .../loadstore/ordered_loads_only.template | 4 + .../sysdeps/loadstore/ordered_stores_only.h | 20 ++++ .../loadstore/ordered_stores_only.template | 4 + .../short_acquire_release_volatile.h | 4 + .../sysdeps/loadstore/short_atomic_load.h | 4 + .../sysdeps/loadstore/short_atomic_store.h | 4 + src/atomic_ops/sysdeps/msftc/arm.h | 4 + src/atomic_ops/sysdeps/msftc/arm64.h | 4 + src/atomic_ops/sysdeps/msftc/common32_defs.h | 4 + src/atomic_ops/sysdeps/msftc/x86.h | 4 + src/atomic_ops/sysdeps/msftc/x86_64.h | 4 + src/atomic_ops/sysdeps/ordered.h | 4 + src/atomic_ops/sysdeps/ordered_except_wr.h | 4 + src/atomic_ops/sysdeps/read_ordered.h | 4 + src/atomic_ops/sysdeps/standard_ao_double_t.h | 4 + src/atomic_ops/sysdeps/sunc/sparc.h | 4 + src/atomic_ops/sysdeps/sunc/x86.h | 4 + .../sysdeps/test_and_set_t_is_ao_t.h | 4 + .../sysdeps/test_and_set_t_is_char.h | 4 + 76 files changed, 450 insertions(+), 68 deletions(-) diff --git a/src/atomic_ops.h b/src/atomic_ops.h index 4a5cfab8..1a6c9c82 100644 --- a/src/atomic_ops.h +++ b/src/atomic_ops.h @@ -528,4 +528,5 @@ struct AO_uintptr_t_size_static_assert { #define AO_T AO_t #define AO_TS_VAL AO_TS_VAL_t +#define AO_ATOMIC_OPS_INCLUDED #endif /* !AO_ATOMIC_OPS_H */ diff --git a/src/atomic_ops/ao_version.h b/src/atomic_ops/ao_version.h index ca084752..7f042fbe 100644 --- a/src/atomic_ops/ao_version.h +++ b/src/atomic_ops/ao_version.h @@ -21,7 +21,7 @@ * SOFTWARE. */ -#ifndef AO_ATOMIC_OPS_H +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) # error This file should not be included directly. #endif diff --git a/src/atomic_ops/generalize-arithm.h b/src/atomic_ops/generalize-arithm.h index 515f52e9..08d46287 100644 --- a/src/atomic_ops/generalize-arithm.h +++ b/src/atomic_ops/generalize-arithm.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* char_compare_and_swap (based on fetch_compare_and_swap) */ #if defined(AO_HAVE_char_fetch_compare_and_swap_full) \ && !defined(AO_HAVE_char_compare_and_swap_full) @@ -872,6 +876,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* short_compare_and_swap (based on fetch_compare_and_swap) */ #if defined(AO_HAVE_short_fetch_compare_and_swap_full) \ && !defined(AO_HAVE_short_compare_and_swap_full) @@ -1724,6 +1732,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* int_compare_and_swap (based on fetch_compare_and_swap) */ #if defined(AO_HAVE_int_fetch_compare_and_swap_full) \ && !defined(AO_HAVE_int_compare_and_swap_full) @@ -2576,6 +2588,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* compare_and_swap (based on fetch_compare_and_swap) */ #if defined(AO_HAVE_fetch_compare_and_swap_full) \ && !defined(AO_HAVE_compare_and_swap_full) diff --git a/src/atomic_ops/generalize-arithm.template b/src/atomic_ops/generalize-arithm.template index 0a21ec23..ce356ba2 100644 --- a/src/atomic_ops/generalize-arithm.template +++ b/src/atomic_ops/generalize-arithm.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* XSIZE_compare_and_swap (based on fetch_compare_and_swap) */ #if defined(AO_HAVE_XSIZE_fetch_compare_and_swap_full) \ && !defined(AO_HAVE_XSIZE_compare_and_swap_full) diff --git a/src/atomic_ops/generalize-small.h b/src/atomic_ops/generalize-small.h index d93d0e82..62b0fb07 100644 --- a/src/atomic_ops/generalize-small.h +++ b/src/atomic_ops/generalize-small.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* char_fetch_compare_and_swap */ #if defined(AO_HAVE_char_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ @@ -548,6 +552,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* short_fetch_compare_and_swap */ #if defined(AO_HAVE_short_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ @@ -1076,6 +1084,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* int_fetch_compare_and_swap */ #if defined(AO_HAVE_int_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ @@ -1604,6 +1616,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* fetch_compare_and_swap */ #if defined(AO_HAVE_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ @@ -2132,6 +2148,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* double_fetch_compare_and_swap */ #if defined(AO_HAVE_double_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ diff --git a/src/atomic_ops/generalize-small.template b/src/atomic_ops/generalize-small.template index d3490f87..88a49136 100644 --- a/src/atomic_ops/generalize-small.template +++ b/src/atomic_ops/generalize-small.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* XSIZE_fetch_compare_and_swap */ #if defined(AO_HAVE_XSIZE_fetch_compare_and_swap) \ && defined(AO_HAVE_nop_full) \ diff --git a/src/atomic_ops/generalize.h b/src/atomic_ops/generalize.h index 73b06ed1..971cac0b 100644 --- a/src/atomic_ops/generalize.h +++ b/src/atomic_ops/generalize.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * Generalize atomic operations for atomic_ops.h. * Should not be included directly. @@ -43,10 +47,6 @@ * file must define AO_NO_DD_ORDERING. */ -#ifndef AO_ATOMIC_OPS_H -# error This file should not be included directly. -#endif - /* Generate test_and_set_full, if necessary and possible. */ #if !defined(AO_HAVE_test_and_set) && !defined(AO_HAVE_test_and_set_release) \ && !defined(AO_HAVE_test_and_set_acquire) \ diff --git a/src/atomic_ops/sysdeps/all_acquire_release_volatile.h b/src/atomic_ops/sysdeps/all_acquire_release_volatile.h index f0240e4e..026e6903 100644 --- a/src/atomic_ops/sysdeps/all_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/all_acquire_release_volatile.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Describes architectures on which volatile AO_t, unsigned char, */ /* unsigned short, and unsigned int loads and stores have */ /* acquire/release semantics for all normally legal alignments. */ diff --git a/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h b/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h index 7bcaa99b..e72630a9 100644 --- a/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h +++ b/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Describes architectures on which AO_t, unsigned char, unsigned */ /* short, and unsigned int loads and stores are atomic but only if data */ /* is suitably aligned. */ diff --git a/src/atomic_ops/sysdeps/all_atomic_load_store.h b/src/atomic_ops/sysdeps/all_atomic_load_store.h index b9e414f7..c0f6fa93 100644 --- a/src/atomic_ops/sysdeps/all_atomic_load_store.h +++ b/src/atomic_ops/sysdeps/all_atomic_load_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Describes architectures on which AO_t, unsigned char, unsigned */ /* short, and unsigned int loads and stores are atomic for all normally */ /* legal alignments. */ diff --git a/src/atomic_ops/sysdeps/all_atomic_only_load.h b/src/atomic_ops/sysdeps/all_atomic_only_load.h index 695f6b80..6ccaf786 100644 --- a/src/atomic_ops/sysdeps/all_atomic_only_load.h +++ b/src/atomic_ops/sysdeps/all_atomic_only_load.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Describes architectures on which AO_t, unsigned char, unsigned */ /* short, and unsigned int loads are atomic for all normally legal */ /* alignments. */ diff --git a/src/atomic_ops/sysdeps/ao_t_is_int.h b/src/atomic_ops/sysdeps/ao_t_is_int.h index 295998ef..4112ae14 100644 --- a/src/atomic_ops/sysdeps/ao_t_is_int.h +++ b/src/atomic_ops/sysdeps/ao_t_is_int.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ @@ -112,6 +116,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ @@ -204,6 +212,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ @@ -296,6 +308,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ @@ -388,6 +404,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ @@ -480,6 +500,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ diff --git a/src/atomic_ops/sysdeps/ao_t_is_int.template b/src/atomic_ops/sysdeps/ao_t_is_int.template index 620faeab..d00ae41e 100644 --- a/src/atomic_ops/sysdeps/ao_t_is_int.template +++ b/src/atomic_ops/sysdeps/ao_t_is_int.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Inclusion of this file signifies that AO_t is in fact int. */ /* Hence any AO_... operation can also serve as AO_int_... operation. */ diff --git a/src/atomic_ops/sysdeps/armcc/arm_v6.h b/src/atomic_ops/sysdeps/armcc/arm_v6.h index 8e1a75f6..a57035b2 100644 --- a/src/atomic_ops/sysdeps/armcc/arm_v6.h +++ b/src/atomic_ops/sysdeps/armcc/arm_v6.h @@ -14,6 +14,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * A transcription of ARMv6 atomic operations for the ARM Realview Toolchain. * This code works with armcc from RVDS 3.1. diff --git a/src/atomic_ops/sysdeps/emul_cas.h b/src/atomic_ops/sysdeps/emul_cas.h index c322a5b2..ed2d4b68 100644 --- a/src/atomic_ops/sysdeps/emul_cas.h +++ b/src/atomic_ops/sysdeps/emul_cas.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * Ensure, if at all possible, that AO_compare_and_swap_full() is * available. The emulation should be brute-force signal-safe, even @@ -35,10 +39,6 @@ * operate on compare_and_swap locations. */ -#ifndef AO_ATOMIC_OPS_H -# error This file should not be included directly. -#endif - #ifndef AO_HAVE_double_t # include "standard_ao_double_t.h" #endif diff --git a/src/atomic_ops/sysdeps/gcc/aarch64.h b/src/atomic_ops/sysdeps/gcc/aarch64.h index 7ba6bb7b..ac534828 100644 --- a/src/atomic_ops/sysdeps/gcc/aarch64.h +++ b/src/atomic_ops/sysdeps/gcc/aarch64.h @@ -12,9 +12,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* As of clang-5.0 (and gcc-5.4), __atomic_thread_fence is always */ /* translated to DMB (which is inefficient for AO_nop_write). */ /* TODO: Update it for newer Clang and GCC releases. */ diff --git a/src/atomic_ops/sysdeps/gcc/alpha.h b/src/atomic_ops/sysdeps/gcc/alpha.h index 59c669e0..e32b489d 100644 --- a/src/atomic_ops/sysdeps/gcc/alpha.h +++ b/src/atomic_ops/sysdeps/gcc/alpha.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../loadstore/atomic_load.h" #include "../loadstore/atomic_store.h" diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index e02aad17..e3be07ba 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -12,9 +12,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if (AO_GNUC_PREREQ(4, 8) || AO_CLANG_PREREQ(3, 5)) \ && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled even for earlier gcc/clang versions. */ diff --git a/src/atomic_ops/sysdeps/gcc/avr32.h b/src/atomic_ops/sysdeps/gcc/avr32.h index b0c52c70..61ff92fd 100644 --- a/src/atomic_ops/sysdeps/gcc/avr32.h +++ b/src/atomic_ops/sysdeps/gcc/avr32.h @@ -19,9 +19,12 @@ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_atomic_load_store.h" #include "../ordered.h" /* There are no multiprocessor implementations. */ diff --git a/src/atomic_ops/sysdeps/gcc/cris.h b/src/atomic_ops/sysdeps/gcc/cris.h index f31c21eb..2e4c30f5 100644 --- a/src/atomic_ops/sysdeps/gcc/cris.h +++ b/src/atomic_ops/sysdeps/gcc/cris.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* FIXME: seems to be untested. */ #include "../all_atomic_load_store.h" diff --git a/src/atomic_ops/sysdeps/gcc/e2k.h b/src/atomic_ops/sysdeps/gcc/e2k.h index 0726204d..0539e36e 100644 --- a/src/atomic_ops/sysdeps/gcc/e2k.h +++ b/src/atomic_ops/sysdeps/gcc/e2k.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* As of clang-9, all __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n are missing. */ #define AO_GCC_FORCE_HAVE_CAS diff --git a/src/atomic_ops/sysdeps/gcc/generic-arithm.h b/src/atomic_ops/sysdeps/gcc/generic-arithm.h index 26883283..ec47a93f 100644 --- a/src/atomic_ops/sysdeps/gcc/generic-arithm.h +++ b/src/atomic_ops/sysdeps/gcc/generic-arithm.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_char_ARITHM AO_INLINE unsigned/**/char @@ -57,7 +59,6 @@ AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -66,9 +67,12 @@ AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_short_ARITHM AO_INLINE unsigned/**/short @@ -111,7 +115,6 @@ AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -120,9 +123,12 @@ AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_int_ARITHM AO_INLINE unsigned @@ -165,7 +171,6 @@ AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -174,9 +179,12 @@ AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_ARITHM AO_INLINE AO_t @@ -219,7 +227,6 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -228,9 +235,12 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_char_ARITHM AO_INLINE unsigned/**/char @@ -273,7 +283,6 @@ AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -282,9 +291,12 @@ AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_short_ARITHM AO_INLINE unsigned/**/short @@ -327,7 +339,6 @@ AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/sho * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -336,9 +347,12 @@ AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/sho * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_int_ARITHM AO_INLINE unsigned @@ -381,7 +395,6 @@ AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -390,9 +403,12 @@ AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_ARITHM AO_INLINE AO_t @@ -435,7 +451,6 @@ AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -444,9 +459,12 @@ AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_char_ARITHM AO_INLINE unsigned/**/char @@ -489,7 +507,6 @@ AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -498,9 +515,12 @@ AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_short_ARITHM AO_INLINE unsigned/**/short @@ -543,7 +563,6 @@ AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/sho * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -552,9 +571,12 @@ AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/sho * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_int_ARITHM AO_INLINE unsigned @@ -597,7 +619,6 @@ AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -606,9 +627,12 @@ AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_ARITHM AO_INLINE AO_t @@ -651,7 +675,6 @@ AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -660,9 +683,12 @@ AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_char_ARITHM AO_INLINE unsigned/**/char @@ -705,7 +731,6 @@ AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char inc * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -714,9 +739,12 @@ AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char inc * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_short_ARITHM AO_INLINE unsigned/**/short @@ -759,7 +787,6 @@ AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -768,9 +795,12 @@ AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_int_ARITHM AO_INLINE unsigned @@ -813,7 +843,6 @@ AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -822,9 +851,12 @@ AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_ARITHM AO_INLINE AO_t diff --git a/src/atomic_ops/sysdeps/gcc/generic-arithm.template b/src/atomic_ops/sysdeps/gcc/generic-arithm.template index 916d1338..38e897a7 100644 --- a/src/atomic_ops/sysdeps/gcc/generic-arithm.template +++ b/src/atomic_ops/sysdeps/gcc/generic-arithm.template @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifndef AO_NO_XSIZE_ARITHM AO_INLINE XCTYPE diff --git a/src/atomic_ops/sysdeps/gcc/generic-small.h b/src/atomic_ops/sysdeps/gcc/generic-small.h index fb78a75b..1e47d70c 100644 --- a/src/atomic_ops/sysdeps/gcc/generic-small.h +++ b/src/atomic_ops/sysdeps/gcc/generic-small.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if !defined(AO_GCC_HAVE_char_SYNC_CAS) || !defined(AO_PREFER_GENERALIZED) AO_INLINE unsigned/**/char @@ -161,7 +163,6 @@ AO_char_load_acquire(const volatile unsigned/**/char *addr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -170,9 +171,12 @@ AO_char_load_acquire(const volatile unsigned/**/char *addr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if !defined(AO_GCC_HAVE_short_SYNC_CAS) || !defined(AO_PREFER_GENERALIZED) AO_INLINE unsigned/**/short @@ -319,7 +323,6 @@ AO_short_load_acquire(const volatile unsigned/**/short *addr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -328,9 +331,12 @@ AO_short_load_acquire(const volatile unsigned/**/short *addr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if !defined(AO_GCC_HAVE_int_SYNC_CAS) || !defined(AO_PREFER_GENERALIZED) AO_INLINE unsigned @@ -477,7 +483,6 @@ AO_int_load_acquire(const volatile unsigned *addr) * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -486,9 +491,12 @@ AO_int_load_acquire(const volatile unsigned *addr) * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if !defined(AO_GCC_HAVE_SYNC_CAS) || !defined(AO_PREFER_GENERALIZED) AO_INLINE AO_t diff --git a/src/atomic_ops/sysdeps/gcc/generic-small.template b/src/atomic_ops/sysdeps/gcc/generic-small.template index 7c2f738f..2c850bac 100644 --- a/src/atomic_ops/sysdeps/gcc/generic-small.template +++ b/src/atomic_ops/sysdeps/gcc/generic-small.template @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if !defined(AO_GCC_HAVE_XSIZE_SYNC_CAS) || !defined(AO_PREFER_GENERALIZED) AO_INLINE XCTYPE diff --git a/src/atomic_ops/sysdeps/gcc/generic.h b/src/atomic_ops/sysdeps/gcc/generic.h index 032990ca..7794147c 100644 --- a/src/atomic_ops/sysdeps/gcc/generic.h +++ b/src/atomic_ops/sysdeps/gcc/generic.h @@ -12,9 +12,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* The following implementation assumes GCC 4.7 or later. */ /* For the details, see GNU Manual, chapter 6.52 (Built-in functions */ /* for memory model aware atomic operations). */ diff --git a/src/atomic_ops/sysdeps/gcc/hexagon.h b/src/atomic_ops/sysdeps/gcc/hexagon.h index cffffe81..d4161aad 100644 --- a/src/atomic_ops/sysdeps/gcc/hexagon.h +++ b/src/atomic_ops/sysdeps/gcc/hexagon.h @@ -9,6 +9,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if AO_CLANG_PREREQ(3, 9) && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled for earlier clang versions as well. */ diff --git a/src/atomic_ops/sysdeps/gcc/hppa.h b/src/atomic_ops/sysdeps/gcc/hppa.h index 2d0c491c..b78a2f09 100644 --- a/src/atomic_ops/sysdeps/gcc/hppa.h +++ b/src/atomic_ops/sysdeps/gcc/hppa.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_atomic_load_store.h" /* Some architecture set descriptions include special "ordered" memory */ diff --git a/src/atomic_ops/sysdeps/gcc/ia64.h b/src/atomic_ops/sysdeps/gcc/ia64.h index 98627d53..7d803179 100644 --- a/src/atomic_ops/sysdeps/gcc/ia64.h +++ b/src/atomic_ops/sysdeps/gcc/ia64.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_atomic_load_store.h" #include "../all_acquire_release_volatile.h" diff --git a/src/atomic_ops/sysdeps/gcc/m68k.h b/src/atomic_ops/sysdeps/gcc/m68k.h index 27e62f6d..362cc11b 100644 --- a/src/atomic_ops/sysdeps/gcc/m68k.h +++ b/src/atomic_ops/sysdeps/gcc/m68k.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* The cas instruction causes an emulation trap for the */ /* 060 with a misaligned pointer, so let's avoid this. */ #undef AO_t diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h index 94c4e24d..a23d31ea 100644 --- a/src/atomic_ops/sysdeps/gcc/mips.h +++ b/src/atomic_ops/sysdeps/gcc/mips.h @@ -11,6 +11,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * FIXME: This should probably make finer distinctions. SGI MIPS is * much more strongly ordered, and in fact closer to sequentially diff --git a/src/atomic_ops/sysdeps/gcc/powerpc.h b/src/atomic_ops/sysdeps/gcc/powerpc.h index 509dd800..4c053b9b 100644 --- a/src/atomic_ops/sysdeps/gcc/powerpc.h +++ b/src/atomic_ops/sysdeps/gcc/powerpc.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Memory model documented at http://www-106.ibm.com/developerworks/ */ /* eserver/articles/archguide.html and (clearer) */ /* http://www-106.ibm.com/developerworks/eserver/articles/powerpc.html. */ diff --git a/src/atomic_ops/sysdeps/gcc/riscv.h b/src/atomic_ops/sysdeps/gcc/riscv.h index 261093b7..e3e239be 100644 --- a/src/atomic_ops/sysdeps/gcc/riscv.h +++ b/src/atomic_ops/sysdeps/gcc/riscv.h @@ -9,6 +9,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if defined(__clang__) || defined(AO_PREFER_BUILTIN_ATOMICS) /* All __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros are still missing. */ /* The operations are lock-free even for the types smaller than word. */ diff --git a/src/atomic_ops/sysdeps/gcc/s390.h b/src/atomic_ops/sysdeps/gcc/s390.h index a302b7ab..774862c7 100644 --- a/src/atomic_ops/sysdeps/gcc/s390.h +++ b/src/atomic_ops/sysdeps/gcc/s390.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if (AO_GNUC_PREREQ(5, 4) || AO_CLANG_PREREQ(8, 0)) && defined(__s390x__) \ && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled for earlier clang/gcc versions. */ diff --git a/src/atomic_ops/sysdeps/gcc/sh.h b/src/atomic_ops/sysdeps/gcc/sh.h index 8534038c..ba08de8b 100644 --- a/src/atomic_ops/sysdeps/gcc/sh.h +++ b/src/atomic_ops/sysdeps/gcc/sh.h @@ -1,7 +1,6 @@ /* * Copyright (c) 2009 by Takashi YOSHII. All rights reserved. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,6 +11,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_atomic_load_store.h" #include "../ordered.h" diff --git a/src/atomic_ops/sysdeps/gcc/sparc.h b/src/atomic_ops/sysdeps/gcc/sparc.h index 3f107d8f..1af59307 100644 --- a/src/atomic_ops/sysdeps/gcc/sparc.h +++ b/src/atomic_ops/sysdeps/gcc/sparc.h @@ -3,7 +3,6 @@ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. * - * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * @@ -12,9 +11,12 @@ * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. - * */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if (AO_GNUC_PREREQ(12, 0) || AO_CLANG_PREREQ(13, 0)) \ && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled for earlier compiler versions as well. */ diff --git a/src/atomic_ops/sysdeps/gcc/tile.h b/src/atomic_ops/sysdeps/gcc/tile.h index 6d284b1a..151168cf 100644 --- a/src/atomic_ops/sysdeps/gcc/tile.h +++ b/src/atomic_ops/sysdeps/gcc/tile.h @@ -9,6 +9,10 @@ * modified is included with the above copyright notice. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if (AO_GNUC_PREREQ(4, 8) || AO_CLANG_PREREQ(3, 4)) \ && !defined(AO_DISABLE_GCC_ATOMICS) diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 13f4a7cc..59aa74b7 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -16,6 +16,10 @@ * Some of the machine specific code was borrowed from our GC distribution. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #if (AO_GNUC_PREREQ(4, 8) || AO_CLANG_PREREQ(3, 4)) \ && !defined(__INTEL_COMPILER) /* TODO: test and enable icc */ \ && !defined(AO_DISABLE_GCC_ATOMICS) diff --git a/src/atomic_ops/sysdeps/generic_pthread.h b/src/atomic_ops/sysdeps/generic_pthread.h index 724b148b..44834a0b 100644 --- a/src/atomic_ops/sysdeps/generic_pthread.h +++ b/src/atomic_ops/sysdeps/generic_pthread.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* The following is useful primarily for debugging and documentation. */ /* We define various atomic operations by acquiring a global pthread */ /* lock. The resulting implementation will perform poorly, but should */ diff --git a/src/atomic_ops/sysdeps/hpc/hppa.h b/src/atomic_ops/sysdeps/hpc/hppa.h index f0da9480..701e5683 100644 --- a/src/atomic_ops/sysdeps/hpc/hppa.h +++ b/src/atomic_ops/sysdeps/hpc/hppa.h @@ -22,6 +22,10 @@ * Derived from the corresponding header file for gcc. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../loadstore/atomic_load.h" #include "../loadstore/atomic_store.h" diff --git a/src/atomic_ops/sysdeps/hpc/ia64.h b/src/atomic_ops/sysdeps/hpc/ia64.h index 061e55b3..5ccd2a34 100644 --- a/src/atomic_ops/sysdeps/hpc/ia64.h +++ b/src/atomic_ops/sysdeps/hpc/ia64.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * This file specifies Itanimum primitives for use with the HP compiler * under HP/UX. We use intrinsics instead of the inline assembly code in the diff --git a/src/atomic_ops/sysdeps/ibmc/powerpc.h b/src/atomic_ops/sysdeps/ibmc/powerpc.h index 37303263..1196cacc 100644 --- a/src/atomic_ops/sysdeps/ibmc/powerpc.h +++ b/src/atomic_ops/sysdeps/ibmc/powerpc.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Memory model documented at http://www-106.ibm.com/developerworks/ */ /* eserver/articles/archguide.html and (clearer) */ /* http://www-106.ibm.com/developerworks/eserver/articles/powerpc.html. */ diff --git a/src/atomic_ops/sysdeps/icc/ia64.h b/src/atomic_ops/sysdeps/icc/ia64.h index 6654209d..0c1b9621 100644 --- a/src/atomic_ops/sysdeps/icc/ia64.h +++ b/src/atomic_ops/sysdeps/icc/ia64.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * This file specifies Itanimum primitives for use with the Intel (ecc) * compiler. We use intrinsics instead of the inline assembly code in the diff --git a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h index 2dd40ec9..e78f205f 100644 --- a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file adds definitions appropriate for environments in which */ /* volatile load of a given type has acquire semantics, and volatile */ /* store of a given type has release semantics. This is arguably */ diff --git a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template index 0d83b530..ea5a7078 100644 --- a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template +++ b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file adds definitions appropriate for environments in which */ /* volatile load of a given type has acquire semantics, and volatile */ /* store of a given type has release semantics. This is arguably */ diff --git a/src/atomic_ops/sysdeps/loadstore/atomic_load.h b/src/atomic_ops/sysdeps/loadstore/atomic_load.h index 38c23e40..b8d563f7 100644 --- a/src/atomic_ops/sysdeps/loadstore/atomic_load.h +++ b/src/atomic_ops/sysdeps/loadstore/atomic_load.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/atomic_load.template b/src/atomic_ops/sysdeps/loadstore/atomic_load.template index 26b7e4e3..e7ea57dd 100644 --- a/src/atomic_ops/sysdeps/loadstore/atomic_load.template +++ b/src/atomic_ops/sysdeps/loadstore/atomic_load.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/atomic_store.h b/src/atomic_ops/sysdeps/loadstore/atomic_store.h index 9d5cf554..e52f73d9 100644 --- a/src/atomic_ops/sysdeps/loadstore/atomic_store.h +++ b/src/atomic_ops/sysdeps/loadstore/atomic_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which stores of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/atomic_store.template b/src/atomic_ops/sysdeps/loadstore/atomic_store.template index 56bba45d..03411158 100644 --- a/src/atomic_ops/sysdeps/loadstore/atomic_store.template +++ b/src/atomic_ops/sysdeps/loadstore/atomic_store.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which stores of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h index 9c78b856..2f8ba2b8 100644 --- a/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file adds definitions appropriate for environments in which */ /* volatile load of a given type has acquire semantics, and volatile */ /* store of a given type has release semantics. This is arguably */ diff --git a/src/atomic_ops/sysdeps/loadstore/char_atomic_load.h b/src/atomic_ops/sysdeps/loadstore/char_atomic_load.h index 8927b7d5..c6660ded 100644 --- a/src/atomic_ops/sysdeps/loadstore/char_atomic_load.h +++ b/src/atomic_ops/sysdeps/loadstore/char_atomic_load.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/char_atomic_store.h b/src/atomic_ops/sysdeps/loadstore/char_atomic_store.h index f1fa8954..888257b6 100644 --- a/src/atomic_ops/sysdeps/loadstore/char_atomic_store.h +++ b/src/atomic_ops/sysdeps/loadstore/char_atomic_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which stores of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h b/src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h index 85debd05..5ac5dc35 100644 --- a/src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h +++ b/src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which AO_double_t loads and stores */ /* are atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h index 13f2fe65..bd4b58c4 100644 --- a/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file adds definitions appropriate for environments in which */ /* volatile load of a given type has acquire semantics, and volatile */ /* store of a given type has release semantics. This is arguably */ diff --git a/src/atomic_ops/sysdeps/loadstore/int_atomic_load.h b/src/atomic_ops/sysdeps/loadstore/int_atomic_load.h index ecc4b3a7..2c5d2847 100644 --- a/src/atomic_ops/sysdeps/loadstore/int_atomic_load.h +++ b/src/atomic_ops/sysdeps/loadstore/int_atomic_load.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/int_atomic_store.h b/src/atomic_ops/sysdeps/loadstore/int_atomic_store.h index 3c32b306..0ae3f592 100644 --- a/src/atomic_ops/sysdeps/loadstore/int_atomic_store.h +++ b/src/atomic_ops/sysdeps/loadstore/int_atomic_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which stores of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h b/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h index a64cfafc..bfff7a92 100644 --- a/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h +++ b/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_char_load /* char_load_read is defined in generalize-small. */ # define AO_char_load_acquire(addr) AO_char_load_read(addr) @@ -47,6 +51,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_short_load /* short_load_read is defined in generalize-small. */ # define AO_short_load_acquire(addr) AO_short_load_read(addr) @@ -74,6 +82,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_int_load /* int_load_read is defined in generalize-small. */ # define AO_int_load_acquire(addr) AO_int_load_read(addr) @@ -101,6 +113,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_load /* load_read is defined in generalize-small. */ # define AO_load_acquire(addr) AO_load_read(addr) @@ -128,6 +144,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_double_load /* double_load_read is defined in generalize-small. */ # define AO_double_load_acquire(addr) AO_double_load_read(addr) diff --git a/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.template b/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.template index 45c5c1d5..8287b56c 100644 --- a/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.template +++ b/src/atomic_ops/sysdeps/loadstore/ordered_loads_only.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_XSIZE_load /* XSIZE_load_read is defined in generalize-small. */ # define AO_XSIZE_load_acquire(addr) AO_XSIZE_load_read(addr) diff --git a/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h b/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h index a427f3bd..4d5e2807 100644 --- a/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h +++ b/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_char_store # define AO_char_store_release(addr, val) \ (AO_nop_write(), AO_char_store(addr, val)) @@ -47,6 +51,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_short_store # define AO_short_store_release(addr, val) \ (AO_nop_write(), AO_short_store(addr, val)) @@ -74,6 +82,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_int_store # define AO_int_store_release(addr, val) \ (AO_nop_write(), AO_int_store(addr, val)) @@ -101,6 +113,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_store # define AO_store_release(addr, val) \ (AO_nop_write(), AO_store(addr, val)) @@ -128,6 +144,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_double_store # define AO_double_store_release(addr, val) \ (AO_nop_write(), AO_double_store(addr, val)) diff --git a/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.template b/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.template index c51abc5d..87420caa 100644 --- a/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.template +++ b/src/atomic_ops/sysdeps/loadstore/ordered_stores_only.template @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #ifdef AO_HAVE_XSIZE_store # define AO_XSIZE_store_release(addr, val) \ (AO_nop_write(), AO_XSIZE_store(addr, val)) diff --git a/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h index a7a611f0..35a82d61 100644 --- a/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file adds definitions appropriate for environments in which */ /* volatile load of a given type has acquire semantics, and volatile */ /* store of a given type has release semantics. This is arguably */ diff --git a/src/atomic_ops/sysdeps/loadstore/short_atomic_load.h b/src/atomic_ops/sysdeps/loadstore/short_atomic_load.h index 2370540b..8be5afd9 100644 --- a/src/atomic_ops/sysdeps/loadstore/short_atomic_load.h +++ b/src/atomic_ops/sysdeps/loadstore/short_atomic_load.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/loadstore/short_atomic_store.h b/src/atomic_ops/sysdeps/loadstore/short_atomic_store.h index b9a9dc6e..dfb64a35 100644 --- a/src/atomic_ops/sysdeps/loadstore/short_atomic_store.h +++ b/src/atomic_ops/sysdeps/loadstore/short_atomic_store.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Definitions for architectures on which stores of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ diff --git a/src/atomic_ops/sysdeps/msftc/arm.h b/src/atomic_ops/sysdeps/msftc/arm.h index 0458cddc..2cd1f0ea 100644 --- a/src/atomic_ops/sysdeps/msftc/arm.h +++ b/src/atomic_ops/sysdeps/msftc/arm.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* Some ARM slide set, if it has been read correctly, claims that Loads */ /* followed by either a Load or a Store are ordered, but nothing else. */ /* It is assumed that Windows interrupt handlers clear the LL/SC flag. */ diff --git a/src/atomic_ops/sysdeps/msftc/arm64.h b/src/atomic_ops/sysdeps/msftc/arm64.h index 367042af..a644bc33 100644 --- a/src/atomic_ops/sysdeps/msftc/arm64.h +++ b/src/atomic_ops/sysdeps/msftc/arm64.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_aligned_atomic_load_store.h" #ifndef AO_ASSUME_WINDOWS98 diff --git a/src/atomic_ops/sysdeps/msftc/common32_defs.h b/src/atomic_ops/sysdeps/msftc/common32_defs.h index ece41f74..7bb93b07 100644 --- a/src/atomic_ops/sysdeps/msftc/common32_defs.h +++ b/src/atomic_ops/sysdeps/msftc/common32_defs.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* This file contains AO primitives based on VC++ built-in intrinsic */ /* functions commonly available across 32- and 64-bit architectures. */ diff --git a/src/atomic_ops/sysdeps/msftc/x86.h b/src/atomic_ops/sysdeps/msftc/x86.h index ba2400a5..378333c4 100644 --- a/src/atomic_ops/sysdeps/msftc/x86.h +++ b/src/atomic_ops/sysdeps/msftc/x86.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_aligned_atomic_load_store.h" #if !defined(AO_ASSUME_VISTA) && _MSC_VER >= 1910 diff --git a/src/atomic_ops/sysdeps/msftc/x86_64.h b/src/atomic_ops/sysdeps/msftc/x86_64.h index ad98f0b1..9a3810bb 100644 --- a/src/atomic_ops/sysdeps/msftc/x86_64.h +++ b/src/atomic_ops/sysdeps/msftc/x86_64.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_aligned_atomic_load_store.h" /* Real X86 implementations appear */ diff --git a/src/atomic_ops/sysdeps/ordered.h b/src/atomic_ops/sysdeps/ordered.h index ba9822d3..44db17cc 100644 --- a/src/atomic_ops/sysdeps/ordered.h +++ b/src/atomic_ops/sysdeps/ordered.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* These are common definitions for architectures that provide */ /* processor ordered memory operations. */ diff --git a/src/atomic_ops/sysdeps/ordered_except_wr.h b/src/atomic_ops/sysdeps/ordered_except_wr.h index 78f44717..c77a4b34 100644 --- a/src/atomic_ops/sysdeps/ordered_except_wr.h +++ b/src/atomic_ops/sysdeps/ordered_except_wr.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * These are common definitions for architectures that provide processor * ordered memory operations except that a later read may pass an diff --git a/src/atomic_ops/sysdeps/read_ordered.h b/src/atomic_ops/sysdeps/read_ordered.h index 420cd970..3b739e1d 100644 --- a/src/atomic_ops/sysdeps/read_ordered.h +++ b/src/atomic_ops/sysdeps/read_ordered.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * These are common definitions for architectures that provide processor * ordered memory operations except that a later read may pass an diff --git a/src/atomic_ops/sysdeps/standard_ao_double_t.h b/src/atomic_ops/sysdeps/standard_ao_double_t.h index daa5266f..8a8a2d71 100644 --- a/src/atomic_ops/sysdeps/standard_ao_double_t.h +++ b/src/atomic_ops/sysdeps/standard_ao_double_t.h @@ -21,6 +21,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_HAVE_double_t) +# error This file should not be included directly (mostly). +#endif + /* We expect AO_double_t to hold two AO_t's. */ #if (((defined(__x86_64__) && defined(AO_GCC_ATOMIC_TEST_AND_SET)) \ diff --git a/src/atomic_ops/sysdeps/sunc/sparc.h b/src/atomic_ops/sysdeps/sunc/sparc.h index 5530fd0e..22020f34 100644 --- a/src/atomic_ops/sysdeps/sunc/sparc.h +++ b/src/atomic_ops/sysdeps/sunc/sparc.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + #include "../all_atomic_load_store.h" /* Real SPARC code uses TSO: */ diff --git a/src/atomic_ops/sysdeps/sunc/x86.h b/src/atomic_ops/sysdeps/sunc/x86.h index 5efda250..b9e3d31d 100644 --- a/src/atomic_ops/sysdeps/sunc/x86.h +++ b/src/atomic_ops/sysdeps/sunc/x86.h @@ -16,6 +16,10 @@ * Some of the machine specific code was borrowed from our GC distribution. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* The following really assume we have a 486 or better. */ #include "../all_aligned_atomic_load_store.h" diff --git a/src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h b/src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h index fd3868da..c9b81bf6 100644 --- a/src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h +++ b/src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * These are common definitions for architectures on which test_and_set * operates on pointer-sized quantities, the "clear" value contains diff --git a/src/atomic_ops/sysdeps/test_and_set_t_is_char.h b/src/atomic_ops/sysdeps/test_and_set_t_is_char.h index 113a6b93..e85521c6 100644 --- a/src/atomic_ops/sysdeps/test_and_set_t_is_char.h +++ b/src/atomic_ops/sysdeps/test_and_set_t_is_char.h @@ -20,6 +20,10 @@ * SOFTWARE. */ +#if !defined(AO_ATOMIC_OPS_H) || defined(AO_ATOMIC_OPS_INCLUDED) +# error This file should not be included directly. +#endif + /* * These are common definitions for architectures on which test_and_set * operates on byte sized quantities, the "clear" value contains