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

Comparing deliantra/server/include/util.h (file contents):
Revision 1.46 by root, Mon May 28 21:15:56 2007 UTC vs.
Revision 1.47 by root, Sat Jun 2 03:48:29 2007 UTC

33# define is_constant(c) 0 33# define is_constant(c) 0
34# define expect(expr,value) (expr) 34# define expect(expr,value) (expr)
35# define prefetch(addr,rw,locality) 35# define prefetch(addr,rw,locality)
36#endif 36#endif
37 37
38#if __GNUC__ < 4 || (__GNUC__ == 4 || __GNUC_MINOR__ < 4)
39# define decltype(x) typeof(x)
40#endif
41
38// put into ifs if you are very sure that the expression 42// put into ifs if you are very sure that the expression
39// is mostly true or mosty false. note that these return 43// is mostly true or mosty false. note that these return
40// booleans, not the expression. 44// booleans, not the expression.
41#define expect_false(expr) expect ((expr) != 0, 0) 45#define expect_false(expr) expect ((expr) != 0, 0)
42#define expect_true(expr) expect ((expr) != 0, 1) 46#define expect_true(expr) expect ((expr) != 0, 1)
50 54
51#include <shstr.h> 55#include <shstr.h>
52#include <traits.h> 56#include <traits.h>
53 57
54// use a gcc extension for auto declarations until ISO C++ sanctifies them 58// use a gcc extension for auto declarations until ISO C++ sanctifies them
55#define auto(var,expr) typeof(expr) var = (expr) 59#define auto(var,expr) decltype(expr) var = (expr)
56 60
57// very ugly macro that basicaly declares and initialises a variable 61// very ugly macro that basicaly declares and initialises a variable
58// that is in scope for the next statement only 62// that is in scope for the next statement only
59// works only for stuff that can be assigned 0 and converts to false 63// works only for stuff that can be assigned 0 and converts to false
60// (note: works great for pointers) 64// (note: works great for pointers)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines