summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Sessler <bernhard.sessler@corscience.de>2013-12-12 10:17:31 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-12-17 14:00:49 +0000
commitf8cd3430163bde5e8ade2a2245437710b2ec048d (patch)
tree0aff3c420ca6299fdefab8abdf215607ec662913
parent8a91ac7749d7d2bb4e9b5790dc7474d82f88bee2 (diff)
downloadcppunit-f8cd3430163bde5e8ade2a2245437710b2ec048d.tar.gz
src: Fix build with Borland C++ compiler
Change-Id: I0a182186c396f2e45bec76c83506f765f2462b3c Signed-off-by: Bernhard Sessler <bernhard.sessler@corscience.de> Reviewed-on: https://gerrit.libreoffice.org/7115 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--cmake/PlatformChecks.cmake2
-rw-r--r--include/config-auto.h.in3
-rw-r--r--src/cppunit/PlugInManager.cpp15
3 files changed, 19 insertions, 1 deletions
diff --git a/cmake/PlatformChecks.cmake b/cmake/PlatformChecks.cmake
index 5d20bfe..d446586 100644
--- a/cmake/PlatformChecks.cmake
+++ b/cmake/PlatformChecks.cmake
@@ -121,6 +121,8 @@ if(CPPUNIT_HAVE_TYPEINFO)
CPPUNIT_HAVE_RTTI)
endif()
+set(CPPUNIT_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "Size of a void pointer")
+
if(_unsupported_compiler)
message(FATAL_ERROR "Your compiler does not support all features required to build cppunit!")
endif()
diff --git a/include/config-auto.h.in b/include/config-auto.h.in
index 7d7c0ae..1f877ee 100644
--- a/include/config-auto.h.in
+++ b/include/config-auto.h.in
@@ -87,6 +87,9 @@
/* Define if you have the <unistd.h> header file. */
#cmakedefine CPPUNIT_HAVE_UNISTD_H 1
+/* The size of a void pointer */
+#cmakedefine CPPUNIT_SIZEOF_VOID_P @CPPUNIT_SIZEOF_VOID_P@
+
/* Name of package */
#cmakedefine CPPUNIT_PACKAGE "@CPPUNIT_PACKAGE@"
diff --git a/src/cppunit/PlugInManager.cpp b/src/cppunit/PlugInManager.cpp
index 4f8b371..aec7713 100644
--- a/src/cppunit/PlugInManager.cpp
+++ b/src/cppunit/PlugInManager.cpp
@@ -1,6 +1,10 @@
#include <cppunit/config/SourcePrefix.h>
#include <cppunit/XmlOutputterHook.h>
-#include <stdint.h>
+#include <cppunit/config-auto.h>
+
+#ifdef CPPUNIT_HAVE_STDINT_H
+ #include <stdint.h>
+#endif
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -8,6 +12,15 @@
#include <cppunit/plugin/TestPlugIn.h>
#include <cppunit/plugin/DynamicLibraryManager.h>
+#if !defined(CPPUNIT_HAVE_STDINT_H)
+# if (CPPUNIT_SIZEOF_VOID_P == 4)
+ typedef unsigned long int uintptr_t;
+# elif (CPPUNIT_SIZEOF_VOID_P == 8)
+ typedef unsigned long long uintptr_t;
+# else
+# error "Unsupported compiler"
+# endif
+#endif
CPPUNIT_NS_BEGIN