From: Ivan Maidanski Date: Thu, 8 Jun 2017 21:52:07 +0000 (+0300) Subject: Avoid misleading 'AO_t undefined' error if wrong atomic_ops.h included X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0bbf851dfcacab57dc0f2e588bd90f5c20a6a67;p=libatomic_ops 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. --- 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