summaryrefslogtreecommitdiff
path: root/def.h
diff options
context:
space:
mode:
Diffstat (limited to 'def.h')
-rw-r--r--def.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/def.h b/def.h
index d1d97f2..41deabf 100644
--- a/def.h
+++ b/def.h
@@ -28,8 +28,6 @@ in this Software without prior written authorization from The Open Group.
# include "makedepend-config.h"
#endif
-#include <X11/Xos.h>
-#include <X11/Xfuncproto.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -38,6 +36,30 @@ in this Software without prior written authorization from The Open Group.
#include <fcntl.h>
#include <sys/stat.h>
+/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+
+#ifndef _X_ATTRIBUTE_PRINTF
+#if __has_attribute(__format__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
+# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
+#else /* not gcc >= 2.3 */
+# define _X_ATTRIBUTE_PRINTF(x,y)
+#endif
+#endif
+
+#ifndef _X_NORETURN
+#if __has_attribute(noreturn) \
+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define _X_NORETURN __attribute((noreturn))
+#else
+# define _X_NORETURN
+#endif /* GNUC */
+#endif
+
#ifndef HAVE_REALLOCARRAY
#define reallocarray(ptr, num, size) realloc(ptr, (num) * (size))
#endif