--- deliantra/server/include/compiler.h 2010/01/05 09:01:22 1.3 +++ deliantra/server/include/compiler.h 2016/11/18 04:46:35 1.17 @@ -1,22 +1,22 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. - * - * Copyright (©) 2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * + * + * Copyright (©) 2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the Affero GNU General Public License * and the GNU General Public License along with this program. If not, see * . - * + * * The authors can be reached via e-mail to */ @@ -31,7 +31,7 @@ # define attribute(attrlist) #endif -#if GCC_VERSION(3,0) +#if GCC_VERSION(3,1) # define is_constant(c) __builtin_constant_p (c) # define expect(expr,value) __builtin_expect ((expr),(value)) # define prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality) @@ -43,9 +43,10 @@ # define noinline #endif -#if GCC_VERSION(3, 0) -# define decltype(x) typeof(x) -#endif +#define func_const attribute ((const)) +#define func_pure attribute ((pure)) +#define func_hot attribute ((hot)) // 4.x +#define func_cold attribute ((cold)) // 4.x #if GCC_VERSION(4,5) # define unreachable() __builtin_unreachable () @@ -61,7 +62,7 @@ #define expect_false(expr) expect ((expr) ? 1 : 0, 0) #define expect_true(expr) expect ((expr) ? 1 : 0, 1) -// try to tell the compiler tat some condition is definitely true +// try to tell the compiler that some condition is definitely true #define assume(cond) do { if (!(cond)) unreachable (); } while (0) #endif