pike.git/src/global.h:37: Inside #if defined(__NT__) and #if undefined(WIN32_LEAN_AND_MEAN)
*/
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
/* We also need to ensure that we get the WIN32 APIs. */
#ifndef WIN32
#define WIN32 100 /* WinNT 1.0 */
#endif
- /* We want WinNT 5.0 API's if available. */
- #if !defined(_WIN32_WINDOWS) || (_WIN32_WINDOWS < 0x500)
+ /* We want WinNT 5.0+ API's if available.
+ *
+ * We avoid the WinNT 6.0+ API's for now.
+ */
+ #if !defined(_WIN32_WINDOWS) || (_WIN32_WINDOWS < 0x5ff)
#undef _WIN32_WINDOWS
- #define _WIN32_WINDOWS 0x0500
+ #define _WIN32_WINDOWS 0x05ff
#endif
- #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x500)
+ #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x5ff)
#undef _WIN32_WINNT
- #define _WIN32_WINNT 0x0500
+ #define _WIN32_WINNT 0x05ff
#endif
/* In later versions of the WIN32 SDKs, we also need to define this one. */
- #if !defined(NTDDI_VERSION) || (NTDDI_VERSION < 0x05000000)
+ #if !defined(NTDDI_VERSION) || (NTDDI_VERSION < 0x05ffffff)
#undef NTDDI_VERSION
- #define NTDDI_VERSION 0x05000000
+ #define NTDDI_VERSION 0x05ffffff
#endif
#endif /* __NT__ */
#ifdef __amigaos__
/* Avoid getting definitions of struct in_addr from <unistd.h>... */
#define __USE_NETINET_IN_H
#endif
/*
pike.git/src/global.h:541:
#endif
#ifndef INLINE
#if defined(__GNUC__) && !defined(PIKE_DEBUG) && !defined(lint)
#define INLINE inline
#else
#define INLINE
#endif
#endif
+ /* Suppress compiler warnings for unused parameters if possible. The mangling of
+ argument name is required to catch when an unused argument later is used without
+ removing the annotation. */
+ #ifndef UNUSED
+ # ifdef __GNUC__
+ # define UNUSED(x) PIKE_CONCAT(x,_UNUSED) __attribute__((unused))
+ # else
+ # define UNUSED(x) PIKE_CONCAT(x,_UNUSED)
+ # endif
+ #endif
+ #ifndef DEBUGUSED
+ # ifdef PIKE_DEBUG
+ # define DEBUGUSED(x) x
+ # else
+ # define DEBUGUSED(x) UNUSED(x)
+ # endif
+ #endif
+
/* PMOD_EXPORT exports a function / variable vfsh. */
#ifndef PMOD_EXPORT
# if defined (__NT__) && defined (USE_DLL)
# ifdef DYNAMIC_MODULE
# define PMOD_EXPORT __declspec(dllimport)
# else
/* A pmod export becomes an import in the dynamic module. This means
* that modules can't use PMOD_EXPORT for identifiers they export
* themselves, unless they are compiled statically. */
# define PMOD_EXPORT __declspec(dllexport)
# endif
-
+ # elif defined(__clang__) && defined(MAC_OS_X_VERSION_MIN_REQUIRED)
+ /* According to Clang source the protected behavior is ELF-specific and not
+ applicable to OS X. */
+ # define PMOD_EXPORT __attribute__ ((visibility("default")))
# elif __GNUC__ >= 4
# ifdef DYNAMIC_MODULE
# define PMOD_EXPORT __attribute__ ((visibility("default")))
# else
# define PMOD_EXPORT __attribute__ ((visibility("protected")))
# endif
# else
# define PMOD_EXPORT
# endif
#endif