[waffle] [PATCH 25/33] examples/gl_basic: use compiler specific (noreturn)
Emil Velikov
emil.l.velikov at gmail.com
Mon Jul 7 10:28:32 PDT 2014
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
examples/gl_basic.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/examples/gl_basic.c b/examples/gl_basic.c
index 28af1ca..6a399bd 100644
--- a/examples/gl_basic.c
+++ b/examples/gl_basic.c
@@ -109,7 +109,15 @@ static const struct option get_opts[] = {
{ 0 },
};
-static void __attribute__((noreturn))
+#if defined(__GNUC__)
+#define NORETURN __attribute__((noreturn))
+#elif defined(_MSC_VER)
+#define NORETURN __declspec(noreturn)
+#else
+#define NORETURN
+#endif
+
+static void NORETURN
error_printf(const char *fmt, ...)
{
va_list ap;
@@ -124,7 +132,8 @@ error_printf(const char *fmt, ...)
exit(EXIT_FAILURE);
}
-static void __attribute__((noreturn))
+
+static void NORETURN
usage_error_printf(const char *fmt, ...)
{
fflush(stdout);
--
2.0.0
More information about the waffle
mailing list