compiler.h: added clang version of FUNC_NO_OPTIMIZE.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1512 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2017-10-01 18:11:29 +00:00
parent cc987b449b
commit b9e5285607

View file

@ -199,8 +199,12 @@ typedef int ssize_t;
#define FUNCP_PRINTF(x,y)
#endif
/* llvm's optnone function attribute started with clang-3.5.0 */
#if defined(__clang__) && \
(__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5))
#define FUNC_NO_OPTIMIZE __attribute__((__optnone__))
/* function optimize attribute is added starting with gcc 4.4.0 */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3))
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3))
#define FUNC_NO_OPTIMIZE __attribute__((__optimize__("0")))
#else
#define FUNC_NO_OPTIMIZE