From f8aaeec886ba2d1119a2dc7f578257da09dfb61a Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 9 Jun 2017 00:52:07 +0300 Subject: [PATCH] Avoid misleading 'AO_t undefined' error if wrong atomic_ops.h included This change might be useful e.g. in case of compilation by Hexagon SDK which has own atomic_ops.h file (not related to libatomic_ops). * tests/run_parallel.h [!CPPCHECK]: Issue #error if AO_ATOMIC_OPS_H is not defined after #include atomic_ops.h. --- tests/run_parallel.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/run_parallel.h b/tests/run_parallel.h index c61d359..dee7146 100644 --- a/tests/run_parallel.h +++ b/tests/run_parallel.h @@ -33,6 +33,10 @@ #include "atomic_ops.h" +#if !defined(AO_ATOMIC_OPS_H) && !defined(CPPCHECK) +# error Wrong atomic_ops.h included. +#endif + #if (defined(_WIN32_WCE) || defined(__MINGW32CE__)) && !defined(AO_HAVE_abort) # define abort() _exit(-1) /* there is no abort() in WinCE */ #endif -- 2.50.1