summaryrefslogtreecommitdiff
path: root/machdep.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-08-19 11:25:24 -0700
committerGuy Harris <guy@alum.mit.edu>2017-08-19 11:25:24 -0700
commit3dc736d939536bcd843597cb655fcba28268705c (patch)
tree6c69e8113f12d847aa00e1c56df66c5777a43137 /machdep.c
parent297bf6343f27ea1d18e5dad529c253ffd3935d41 (diff)
downloadtcpdump-3dc736d939536bcd843597cb655fcba28268705c.tar.gz
Handle attributes for function pointers by checking the compiler version.
Handle attributes for function pointers the same way we handle attributes for functions, by explicitly checking for the compiler version with #if rather than with a configure script check. That's one fewer thing that, if you're not using autoconf, has to be done in some other fashion. While we're at it, put NORETURN in the right place to have it work with Microsoft Visual Studio as well as various UN*X compilers.
Diffstat (limited to 'machdep.c')
-rw-r--r--machdep.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/machdep.c b/machdep.c
index 1f086161..df16c6e2 100644
--- a/machdep.c
+++ b/machdep.c
@@ -31,20 +31,12 @@
*/
#include <netdissect-stdinc.h>
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif /* HAVE___ATTRIBUTE__ */
-
#ifdef __osf__
#include <sys/sysinfo.h>
#include <sys/proc.h>
#if !defined(HAVE_SNPRINTF)
-int snprintf(char *, size_t, const char *, ...)
-#ifdef __ATTRIBUTE___FORMAT_OK
- __attribute__((format(printf, 3, 4)))
-#endif /* __ATTRIBUTE___FORMAT_OK */
- ;
+int snprintf(char *, size_t, const char *, ...) PRINTFLIKE(3, 4);
#endif /* !defined(HAVE_SNPRINTF) */
#endif /* __osf__ */