From 7d1879b77730220fa6f9e4e9380f7084309aea86 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 29 Dec 2012 15:21:16 +0000 Subject: [PATCH] Fix LTO=1 RELEASE=1 Lunatic build. git-svn-id: https://svn.eduke32.com/eduke32@3341 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/compat.h | 6 ++++++ polymer/eduke32/source/animvpx.c | 10 ++++------ polymer/eduke32/source/lunatic/lunatic_game.c | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 66b66faa3..4b3eb45ef 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -20,6 +20,12 @@ # define ATTRIBUTE(attrlist) #endif +#if !defined __clang__ && !defined USING_LTO +# define ATTRIBUTE_OPTIMIZE(str) ATTRIBUTE((optimize(str))) +#else +# define ATTRIBUTE_OPTIMIZE(str) +#endif + #ifndef min #define min(x,y) ((x) < (y) ? (x) : (y)) #endif diff --git a/polymer/eduke32/source/animvpx.c b/polymer/eduke32/source/animvpx.c index 805456bc4..6f6396e09 100644 --- a/polymer/eduke32/source/animvpx.c +++ b/polymer/eduke32/source/animvpx.c @@ -208,12 +208,10 @@ const char *animvpx_nextpic_errmsg[] = { // retrieves one picture-frame from the stream // pic format: lines of [Y U V 0] pixels // *picptr==NULL means EOF has been reached -#if !defined __clang__ && !defined USING_LTO -# ifdef DEBUGGINGAIDS -ATTRIBUTE((optimize("O1"))) -# else -ATTRIBUTE((optimize("O3"))) -# endif +#ifdef DEBUGGINGAIDS +ATTRIBUTE_OPTIMIZE("O1") +#else +ATTRIBUTE_OPTIMIZE("O3") #endif int32_t animvpx_nextpic(animvpx_codec_ctx *codec, uint8_t **picptr) { diff --git a/polymer/eduke32/source/lunatic/lunatic_game.c b/polymer/eduke32/source/lunatic/lunatic_game.c index b918993c5..fb09e28f5 100644 --- a/polymer/eduke32/source/lunatic/lunatic_game.c +++ b/polymer/eduke32/source/lunatic/lunatic_game.c @@ -44,7 +44,7 @@ typedef struct { // See: Good Practice in (Pseudo) Random Number Generation for // Bioinformatics Applications, by David Jones -ATTRIBUTE((optimize("O2"))) +ATTRIBUTE_OPTIMIZE("O2") uint32_t rand_jkiss_u32(rng_jkiss_t *s) { uint64_t t; @@ -54,7 +54,7 @@ uint32_t rand_jkiss_u32(rng_jkiss_t *s) return s->x + s->y + s->z; } -ATTRIBUTE((optimize("O2"))) +ATTRIBUTE_OPTIMIZE("O2") double rand_jkiss_dbl(rng_jkiss_t *s) { double x;