From: Steinar H. Gunderson Date: Sun, 3 Feb 2013 14:17:39 +0000 (+0100) Subject: Make util.h private to the effects; instead, defs.h contains what effect.h needs... X-Git-Tag: 1.0~124 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=5df87586a23c6287d00014c781beba3be8297eb4 Make util.h private to the effects; instead, defs.h contains what effect.h needs. Keeps some junk out of the namespace of the client. --- diff --git a/defs.h b/defs.h new file mode 100644 index 0000000..fc4fa92 --- /dev/null +++ b/defs.h @@ -0,0 +1,12 @@ +#ifndef _MOVIT_DEFS_H +#define _MOVIT_DEFS_H + +// Utility macros that are useful from other heder files. + +#ifdef __GNUC__ +#define MUST_CHECK_RESULT __attribute__((warn_unused_result)) +#else +#define MUST_CHECK_RESULT +#endif + +#endif // !defined(_MOVIT_DEFS_H) diff --git a/effect.h b/effect.h index 7884509..ecdd95a 100644 --- a/effect.h +++ b/effect.h @@ -16,7 +16,7 @@ #include #include -#include "util.h" +#include "defs.h" class EffectChain; class Node; diff --git a/util.h b/util.h index e12c2c4..79b5987 100644 --- a/util.h +++ b/util.h @@ -47,12 +47,6 @@ void combine_two_samples(float w1, float w2, float *offset, float *total_weight, #define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at %s:%d\n", err, __FILE__, __LINE__); exit(1); } } #endif -#ifdef __GNUC__ -#define MUST_CHECK_RESULT __attribute__((warn_unused_result)) -#else -#define MUST_CHECK_RESULT -#endif - // CHECK() is like assert(), but retains any side effects no matter the compilation mode. #ifdef NDEBUG #define CHECK(x) (void)(x)