* flavors of UN*X.
*/
+#include "funcattrs.h"
+
#ifdef __cplusplus
extern "C" {
#endif
#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
+ #endif
#define sscanf sscanf_s
#define setbuf(x, y) \
setvbuf((x), (y), _IONBF, 0)
#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