[esnacc-dev] [PATCH 03/11] windows: C99 compliant inlines

Aaron Conole aconole at bytheb.org
Tue Dec 6 19:47:01 UTC 2016


Static inlines under windows don't work as expected.  C99 states that
inlines are specified with 'inline XXX(YYY) { ... }', but the visual
studio compiler is not quite up to C99.  For that, the keyword '__inline'
exists.

Fixes 5f011cfa4060 ("gen-buf: Correct the genbuf macros and functions")
Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
 c-lib/inc/gen-buf.h | 2 ++
 snacc.h             | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/c-lib/inc/gen-buf.h b/c-lib/inc/gen-buf.h
index 7d2d8c4..699a033 100644
--- a/c-lib/inc/gen-buf.h
+++ b/c-lib/inc/gen-buf.h
@@ -26,6 +26,8 @@
 #ifndef _gen_buf_h_
 #define _gen_buf_h_
 
+#include "config.h"
+#include "snacc.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/snacc.h b/snacc.h
index d9732b0..d324a08 100644
--- a/snacc.h
+++ b/snacc.h
@@ -161,4 +161,8 @@
 #define ESNACC_UNUSED
 #endif
 
+#ifdef WIN32
+#define inline __inline
+#endif
+
 #endif /* _SNACC_H_ */
-- 
2.7.4




More information about the dev mailing list