From 5cda5558347902b687025faf1cd6bb507b5b7517 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 14 Mar 2012 21:59:04 +0100 Subject: [PATCH] Fix duplicate case value compiling with mingw-w64 In mingw-w64 both ESOMETHING and WSASOMETHING are defined, leading to a duplicate case in the switch. --- dbus/dbus-sysdeps.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index c2258b3..1a93cea 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -614,16 +614,14 @@ _dbus_error_from_errno (int error_number) #ifdef EPROTONOSUPPORT case EPROTONOSUPPORT: return DBUS_ERROR_NOT_SUPPORTED; -#endif -#ifdef WSAEPROTONOSUPPORT +#elif defined(WSAEPROTONOSUPPORT) case WSAEPROTONOSUPPORT: return DBUS_ERROR_NOT_SUPPORTED; #endif #ifdef EAFNOSUPPORT case EAFNOSUPPORT: return DBUS_ERROR_NOT_SUPPORTED; -#endif -#ifdef WSAEAFNOSUPPORT +#elif defined(WSAEAFNOSUPPORT) case WSAEAFNOSUPPORT: return DBUS_ERROR_NOT_SUPPORTED; #endif @@ -654,32 +652,28 @@ _dbus_error_from_errno (int error_number) #ifdef ECONNREFUSED case ECONNREFUSED: return DBUS_ERROR_NO_SERVER; -#endif -#ifdef WSAECONNREFUSED +#elif defined(WSAECONNREFUSED) case WSAECONNREFUSED: return DBUS_ERROR_NO_SERVER; #endif #ifdef ETIMEDOUT case ETIMEDOUT: return DBUS_ERROR_TIMEOUT; -#endif -#ifdef WSAETIMEDOUT +#elif defined(WSAETIMEDOUT) case WSAETIMEDOUT: return DBUS_ERROR_TIMEOUT; #endif #ifdef ENETUNREACH case ENETUNREACH: return DBUS_ERROR_NO_NETWORK; -#endif -#ifdef WSAENETUNREACH +#elif defined(WSAENETUNREACH) case WSAENETUNREACH: return DBUS_ERROR_NO_NETWORK; #endif #ifdef EADDRINUSE case EADDRINUSE: return DBUS_ERROR_ADDRESS_IN_USE; -#endif -#ifdef WSAEADDRINUSE +#elif defined(WSAEADDRINUSE) case WSAEADDRINUSE: return DBUS_ERROR_ADDRESS_IN_USE; #endif -- 1.7.5.4