Skip to content

Commit

Permalink
Guard against direct include of internal headers from outside
Browse files Browse the repository at this point in the history
(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.
  • Loading branch information
ivmai committed Oct 5, 2024
1 parent f2f2921 commit 059f63c
Show file tree
Hide file tree
Showing 76 changed files with 450 additions and 68 deletions.
1 change: 1 addition & 0 deletions src/atomic_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion src/atomic_ops/ao_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 16 additions & 0 deletions src/atomic_ops/generalize-arithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/generalize-arithm.template
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions src/atomic_ops/generalize-small.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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) \
Expand Down Expand Up @@ -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) \
Expand Down Expand Up @@ -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) \
Expand Down Expand Up @@ -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) \
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/generalize-small.template
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
8 changes: 4 additions & 4 deletions src/atomic_ops/generalize.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) \
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/all_acquire_release_volatile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/all_atomic_load_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/all_atomic_only_load.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
24 changes: 24 additions & 0 deletions src/atomic_ops/sysdeps/ao_t_is_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand Down Expand Up @@ -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. */

Expand Down Expand Up @@ -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. */

Expand Down Expand Up @@ -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. */

Expand Down Expand Up @@ -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. */

Expand Down Expand Up @@ -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. */

Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/ao_t_is_int.template
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/armcc/arm_v6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/atomic_ops/sysdeps/emul_cas.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/atomic_ops/sysdeps/gcc/aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
6 changes: 4 additions & 2 deletions src/atomic_ops/sysdeps/gcc/alpha.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion src/atomic_ops/sysdeps/gcc/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 4 additions & 1 deletion src/atomic_ops/sysdeps/gcc/avr32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/gcc/cris.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/atomic_ops/sysdeps/gcc/e2k.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit 059f63c

Please sign in to comment.