Avoid misleading 'AO_t undefined' error if wrong atomic_ops.h included
authorIvan Maidanski <ivmai@mail.ru>
Thu, 8 Jun 2017 21:52:07 +0000 (00:52 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 20 Sep 2017 07:47:24 +0000 (10:47 +0300)
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

index c61d359..dee7146 100644 (file)
 
 #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