make generated c code work on non-glibc platforms
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index b9a5560..6395022 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -757,7 +757,21 @@
  ****************************************************************/
 
 #ifdef __GNUC__
+#ifdef __linux__
+/* glibc */
 #include <features.h>
+#else
+/* NetBSD etc */
+#include <sys/cdefs.h>
+#ifdef __GNUC_PREREQ__
+#define __GNUC_PREREQ __GNUC_PREREQ__
+#endif
+#endif
+
+#ifndef __GNUC_PREREQ
+/* fallback */
+#define __GNUC_PREREQ(maj, min) 0
+#endif
 
 #if __GNUC_PREREQ(4,4)
 #pragma GCC optimize ("s")