changeset 1976:325772dadcd6

Macro "__linux" (now obsolete) replaced by macro "__linux__"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 14 Apr 2016 17:34:43 +0200
parents 730eedd9a5dc
children ad95331c526a
files Core/Endianness.h Core/MultiThreading/Mutex.cpp Core/Toolbox.cpp NEWS OrthancServer/DicomProtocol/DicomServer.cpp OrthancServer/FromDcmtkBridge.cpp Plugins/Engine/PluginsManager.cpp Plugins/Engine/SharedLibrary.cpp Resources/Patches/mongoose-3.1-patch.diff UnitTestsSources/PluginsTests.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 11 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Endianness.h	Tue Apr 12 18:30:55 2016 +0000
+++ b/Core/Endianness.h	Thu Apr 14 17:34:43 2016 +0200
@@ -37,7 +37,7 @@
  ** LINUX ARCHITECTURES
  ********************************************************************/
 
-#if defined(__linux)
+#if defined(__linux__)
 #  define ORTHANC_HAS_BUILTIN_BYTE_SWAP 1
 #  include <endian.h>
 #endif
--- a/Core/MultiThreading/Mutex.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/Core/MultiThreading/Mutex.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -37,7 +37,7 @@
 
 #if defined(_WIN32)
 #include <windows.h>
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
 #include <pthread.h>
 #else
 #error Support your platform here
@@ -75,7 +75,7 @@
   }
 
 
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__)
 
   struct Mutex::PImpl
   {
--- a/Core/Toolbox.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/Core/Toolbox.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -67,7 +67,7 @@
 #include <limits.h>      /* PATH_MAX */
 #endif
 
-#if defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
 #include <limits.h>      /* PATH_MAX */
 #include <signal.h>
 #include <unistd.h>
@@ -132,7 +132,7 @@
   {
 #if defined(_WIN32)
     ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
-#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
     usleep(microSeconds);
 #else
 #error Support your platform here
@@ -629,7 +629,7 @@
     return std::string(&buffer[0]);
   }
 
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
   static std::string GetPathToExecutableInternal()
   {
     std::vector<char> buffer(PATH_MAX + 1);
--- a/NEWS	Tue Apr 12 18:30:55 2016 +0000
+++ b/NEWS	Thu Apr 14 17:34:43 2016 +0200
@@ -38,6 +38,7 @@
 * Upgrade to Boost 1.60.0 for static builds
 * Use of HTTP status 403 Forbidden (instead of 401) if access to a REST resource is disallowed
 * Option "HttpsVerifyPeers" can be used to connect against self-signed HTTPS certificates
+* Macro "__linux" (now obsolete) replaced by macro "__linux__" (maybe solves Debian bug #821011)
 
 
 Version 1.0.0 (2015/12/15)
--- a/OrthancServer/DicomProtocol/DicomServer.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/OrthancServer/DicomProtocol/DicomServer.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -44,7 +44,7 @@
 
 #include <boost/thread.hpp>
 
-#if defined(__linux)
+#if defined(__linux__)
 #include <cstdlib>
 #endif
 
--- a/OrthancServer/FromDcmtkBridge.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/OrthancServer/FromDcmtkBridge.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -195,7 +195,7 @@
       LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_DICOM);
       LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_PRIVATE);
 
-#elif defined(__linux) || defined(__FreeBSD_kernel__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
       std::string path = DCMTK_DICTIONARY_DIR;
 
       const char* env = std::getenv(DCM_DICT_ENVIRONMENT_VARIABLE);
--- a/Plugins/Engine/PluginsManager.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/Plugins/Engine/PluginsManager.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -48,7 +48,7 @@
 
 #ifdef WIN32
 #define PLUGIN_EXTENSION ".dll"
-#elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
 #define PLUGIN_EXTENSION ".so"
 #elif defined(__APPLE__) && defined(__MACH__)
 #define PLUGIN_EXTENSION ".dylib"
--- a/Plugins/Engine/SharedLibrary.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/Plugins/Engine/SharedLibrary.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -45,7 +45,7 @@
 
 #if defined(_WIN32)
 #include <windows.h>
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
 #include <dlfcn.h>
 #else
 #error Support your platform here
@@ -65,7 +65,7 @@
       throw OrthancException(ErrorCode_SharedLibrary);
     }
 
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
     handle_ = ::dlopen(path_.c_str(), RTLD_NOW);
     if (handle_ == NULL) 
     {
@@ -91,7 +91,7 @@
     {
 #if defined(_WIN32)
       ::FreeLibrary((HMODULE)handle_);
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
       ::dlclose(handle_);
 #else
 #error Support your platform here
@@ -109,7 +109,7 @@
 
 #if defined(_WIN32)
     return ::GetProcAddress((HMODULE)handle_, name.c_str());
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
+#elif defined(__linux__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
     return ::dlsym(handle_, name.c_str());
 #else
 #error Support your platform here
--- a/Resources/Patches/mongoose-3.1-patch.diff	Tue Apr 12 18:30:55 2016 +0000
+++ b/Resources/Patches/mongoose-3.1-patch.diff	Thu Apr 14 17:34:43 2016 +0200
@@ -42,7 +42,7 @@
  
    // Wait until mg_fini() stops
    while (ctx->stop_flag != 2) {
-+#if defined(__linux)
++#if defined(__linux__)
 +    usleep(100000);
 +#elif defined(_WIN32)
 +    Sleep(100);
--- a/UnitTestsSources/PluginsTests.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/UnitTestsSources/PluginsTests.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -57,7 +57,7 @@
   ASSERT_TRUE(l.HasFunction("GetVersionExW"));
   ASSERT_FALSE(l.HasFunction("world"));
 
-#elif defined(__linux) || defined(__FreeBSD_kernel__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
   SharedLibrary l("libdl.so");
   ASSERT_THROW(l.GetFunction("world"), OrthancException);
   ASSERT_TRUE(l.GetFunction("dlopen") != NULL);
--- a/UnitTestsSources/UnitTestsMain.cpp	Tue Apr 12 18:30:55 2016 +0000
+++ b/UnitTestsSources/UnitTestsMain.cpp	Thu Apr 14 17:34:43 2016 +0200
@@ -458,7 +458,7 @@
 }
 
 
-#if defined(__linux)
+#if defined(__linux__)
 TEST(OrthancInitialization, AbsoluteDirectory)
 {
   ASSERT_EQ("/tmp/hello", Configuration::InterpretRelativePath("/tmp", "hello"));
@@ -632,7 +632,7 @@
 
 
 
-#if defined(__linux)
+#if defined(__linux__)
 #include <endian.h>
 #elif defined(__FreeBSD__)
 #include <machine/endian.h>
@@ -657,7 +657,7 @@
    * Linux.
    **/
   
-#elif defined(__linux) || defined(__FreeBSD_kernel__)
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
 
 #if !defined(__BYTE_ORDER)
 #  error Support your platform here