ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/compiler.h
(Generate patch)

Comparing deliantra/server/include/compiler.h (file contents):
Revision 1.2 by root, Sun Nov 8 15:11:23 2009 UTC vs.
Revision 1.10 by root, Sat Apr 23 04:56:48 2011 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
41# define expect(expr,value) (expr) 41# define expect(expr,value) (expr)
42# define prefetch(addr,rw,locality) 42# define prefetch(addr,rw,locality)
43# define noinline 43# define noinline
44#endif 44#endif
45 45
46#if !GCC_VERSION(4,4) 46#if GCC_VERSION(4,5)
47# define decltype(x) __decltype(x)
48#elif GCC_VERSION(3,0)
47# define decltype(x) typeof(x) 49# define decltype(x) typeof(x)
48#endif 50#endif
49 51
50#if GCC_VERSION(4,5) 52#if GCC_VERSION(4,5)
51# define unreachable() __builtin_unreachable () 53# define unreachable() __builtin_unreachable ()
59// is mostly true or mosty false. note that these return 61// is mostly true or mosty false. note that these return
60// booleans, not the expression. 62// booleans, not the expression.
61#define expect_false(expr) expect ((expr) ? 1 : 0, 0) 63#define expect_false(expr) expect ((expr) ? 1 : 0, 0)
62#define expect_true(expr) expect ((expr) ? 1 : 0, 1) 64#define expect_true(expr) expect ((expr) ? 1 : 0, 1)
63 65
64// try to tell the compiler tat some condition is definitely true 66// try to tell the compiler that some condition is definitely true
65#define assume(cond) do { if (!(cond)) unreachable (); } while (0) 67#define assume(cond) do { if (!(cond)) unreachable (); } while (0)
66 68
67#endif 69#endif
68 70

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines