[waffle] [PATCH 2/2] include: Only use restricted keyword with C99

Pauli Nieminen pauli.nieminen at linux.intel.com
Mon May 21 12:01:35 PDT 2012


Restricted keyword was added in C99 that makes it problematic for
projects that are compiled using C90 standard definations. To make C90
sources compile with waffle headers need to remove restrict from headers
if standard version is older than C99.

Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
---
 include/waffle/waffle_gl_misc.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/waffle/waffle_gl_misc.h b/include/waffle/waffle_gl_misc.h
index d7291b0..3098762 100644
--- a/include/waffle/waffle_gl_misc.h
+++ b/include/waffle/waffle_gl_misc.h
@@ -27,6 +27,8 @@
 
 #ifdef __cplusplus
 extern "C" {
+#elif __STDC_VERSION__ < 199901L
+#define restrict
 #endif
 
 struct waffle_context;
@@ -57,6 +59,8 @@ waffle_get_proc_address(const char *name);
 
 #ifdef __cplusplus
 } // end extern "C"
+#elif __STDC_VERSION__ < 199901L
+#undef restrict
 #endif
 
 /// @}
-- 
1.7.5.4



More information about the waffle mailing list