aboutsummaryrefslogtreecommitdiff
path: root/portability.h
diff options
context:
space:
mode:
Diffstat (limited to 'portability.h')
-rw-r--r--portability.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/portability.h b/portability.h
index f050ffa2..179ecd92 100644
--- a/portability.h
+++ b/portability.h
@@ -39,6 +39,8 @@
* flavors of UN*X.
*/
+#include "funcattrs.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -85,20 +87,6 @@ extern "C" {
#endif
#endif
-/*
- * For flagging arguments as format strings in MSVC.
- */
-#if _MSC_VER >= 1400
- #include <sal.h>
- #if _MSC_VER > 1400
- #define FORMAT_STRING(p) _Printf_format_string_ p
- #else
- #define FORMAT_STRING(p) __format_string p
- #endif
-#else
- #define FORMAT_STRING(p) p
-#endif
-
#ifdef _MSC_VER
#ifndef _DEBUG
#define strdup _strdup
@@ -148,11 +136,8 @@ extern "C" {
#ifdef HAVE_SNPRINTF
#define pcap_snprintf snprintf
#else
-extern int pcap_snprintf(char *, size_t, FORMAT_STRING(const char *), ...)
-#ifdef __ATTRIBUTE___FORMAT_OK
- __attribute__((format (printf, 3, 4)))
-#endif /* __ATTRIBUTE___FORMAT_OK */
- ;
+extern int pcap_snprintf(char *, size_t, PCAP_FORMAT_STRING(const char *), ...)
+ PCAP_PRINTFLIKE(3, 4);
#endif
#ifdef HAVE_VSNPRINTF