summaryrefslogtreecommitdiffstats
path: root/hw4/l4basic/l4basic.patch
blob: 1fcafedea0fcbc21c3809a6039329712788457f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- l4common.h.org  2014-01-13 00:43:28.406867323 +0800
+++ l4common.h  2014-01-13 00:48:49.384892938 +0800
@@ -2,31 +2,39 @@
 #ifndef LBS_COMMON_H
 #define LBS_COMMON_H
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stddef.h>
 
 #ifdef __STDC_VERSION__
 # include <stdbool.h>
 # if __STDC_VERSION__ >= 201112L
 #  define LBS_COMMON_ISO_C11
-#  define LBS_COMMON_CHECK_TYPE(x,type) (_Generic ((x), type: (x)))
 # else
 #  define LBS_COMMON_ISO_C99
-#  define LBS_COMMON_CHECK_TYPE(x,type) (x)
 # endif
 #else
 # ifdef __cplusplus
 #  define LBS_COMMON_CXX
-#  define LBS_COMMON_CHECK_TYPE(x,type) (x)
 # else
 #  define bool  char
 #  define true  1
 #  define false 0
 #  define inline
 #  define LBS_COMMON_ISO_C89
-#  define LBS_COMMON_CHECK_TYPE(x,type) (x)
 # endif /* __cplusplus */
 #endif /* __STDC_VERSION__ */
 
+#ifdef HAVE_C__GENERIC
+# define LBS_COMMON_CHECK_TYPE(x,type) (_Generic ((x), type: (x)))
+#else
+# define LBS_COMMON_CHECK_TYPE(x,type) (x)
+#endif
+
+#include "memwrap.h"
+
 #define LBS_COMMON_NULL_PTR ((void*)NULL)
 #define LBS_COMMON_DEFINE_GETTER(ns,xt,m,mt) \
     static inline mt ns ## _get_ ## m (xt x) { \