summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-03-27 18:27:37 +0200
committerDavid Tardon <dtardon@redhat.com>2016-03-27 18:27:37 +0200
commit6a650684b056dab89c44fe25848eb12fb8fbe9b2 (patch)
tree7bb428568cda7accde090bd68cfca708bd340978
parentaf0216198ce999033ae55800df7507aedd69873b (diff)
use boost for int types
-rw-r--r--configure.ac1
-rw-r--r--src/lib/libsw602_utils.h46
2 files changed, 15 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index fce7d1e..65d5fdb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,7 @@ AC_SUBST(REVENGE_LIBS)
# Find boost headers
# ==================
AC_CHECK_HEADERS(
+ boost/cstdint.hpp \
boost/iterator/iterator_facade.hpp \
boost/optional.hpp \
boost/spirit/include/phoenix_core.hpp \
diff --git a/src/lib/libsw602_utils.h b/src/lib/libsw602_utils.h
index 68d7f97..5ffb223 100644
--- a/src/lib/libsw602_utils.h
+++ b/src/lib/libsw602_utils.h
@@ -14,42 +14,22 @@
#include <cstdio>
#endif
+#include <boost/cstdint.hpp>
+
#include <librevenge-stream/librevenge-stream.h>
#include <librevenge/librevenge.h>
-#ifdef _MSC_VER
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef short int16_t;
-typedef unsigned uint32_t;
-typedef int int32_t;
-typedef unsigned __int64 uint64_t;
-typedef __int64 int64_t;
-
-#else
-
-#ifdef HAVE_CONFIG_H
-
-#include <config.h>
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#else
-
-// assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
-#include <stdint.h>
-#include <inttypes.h>
-
-#endif
+namespace libsw602
+{
-#endif
+using boost::uint8_t;
+using boost::int8_t;
+using boost::uint16_t;
+using boost::int16_t;
+using boost::uint32_t;
+using boost::int32_t;
+using boost::uint64_t;
+using boost::int64_t;
/** an noop deleter used to transform a librevenge pointer in a false shared_ptr */
template <class T>
@@ -58,6 +38,8 @@ struct SW602_shared_ptr_noop_deleter
void operator()(T *) {}
};
+}
+
// debug message includes source file and line number
//#define VERBOSE_DEBUG 1