aboutsummaryrefslogtreecommitdiff
path: root/cpp/src/sfntly/port
diff options
context:
space:
mode:
authorarthurhsu <arthurhsu@google.com>2011-07-13 00:02:17 +0000
committerarthurhsu <arthurhsu@google.com>2011-07-13 00:02:17 +0000
commit74dd654d997383188b37566661cbce34a8b82154 (patch)
treedac77e6e3161b357ee7da295a99e8004e36afaad /cpp/src/sfntly/port
parent3e645c2a657691a50763a182495501511988880c (diff)
downloadsfntly-74dd654d997383188b37566661cbce34a8b82154.tar.gz
Add more unit tests and fix I/O bugs.
Add a public domain font and restructure tests. Change cmake to default output debug builds. Fix VC 2008 compilation issues.
Diffstat (limited to 'cpp/src/sfntly/port')
-rw-r--r--cpp/src/sfntly/port/memory_output_stream.h1
-rw-r--r--cpp/src/sfntly/port/type.h22
2 files changed, 18 insertions, 5 deletions
diff --git a/cpp/src/sfntly/port/memory_output_stream.h b/cpp/src/sfntly/port/memory_output_stream.h
index a7654af..4a7cb74 100644
--- a/cpp/src/sfntly/port/memory_output_stream.h
+++ b/cpp/src/sfntly/port/memory_output_stream.h
@@ -17,6 +17,7 @@
#ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SFNTLY_PORT_MEMORY_OUTPUT_STREAM_H_
#define TYPOGRAPHY_FONT_SFNTLY_SRC_SFNTLY_PORT_MEMORY_OUTPUT_STREAM_H_
+#include <cstddef>
#include <vector>
#include "sfntly/port/type.h"
diff --git a/cpp/src/sfntly/port/type.h b/cpp/src/sfntly/port/type.h
index 25b697e..bb51993 100644
--- a/cpp/src/sfntly/port/type.h
+++ b/cpp/src/sfntly/port/type.h
@@ -21,17 +21,27 @@
#if defined (_MSC_VER) && (_MSC_VER < 1600)
typedef unsigned char uint8_t;
- typedef char int8_t;
+ typedef signed char int8_t;
typedef unsigned __int16 uint16_t;
- typedef __int16 int16_t;
+ typedef signed __int16 int16_t;
typedef unsigned __int32 uint32_t;
- typedef __int32 int32_t;
+ typedef signed __int32 int32_t;
typedef unsigned __int64 uint64_t;
- typedef __int64 int64_t;
+ typedef signed __int64 int64_t;
+ // Definitions to avoid ICU redefinition issue
+ #define U_HAVE_INT8_T 1
+ #define U_HAVE_UINT8_T 1
+ #define U_HAVE_INT16_T 1
+ #define U_HAVE_UINT16_T 1
+ #define U_HAVE_INT32_T 1
+ #define U_HAVE_UINT32_T 1
+ #define U_HAVE_INT64_T 1
+ #define U_HAVE_UINT64_T 1
#else
#include <stdint.h>
#endif
+#include <cstddef>
#include <vector>
#include <set>
@@ -71,7 +81,9 @@ inline To down_cast(From* f) { // so we only accept pointers
#pragma warning(pop)
#endif
-#if !defined(NDEBUG)
+// The following code is the only place for RTTI. It is done so to allow VC++
+// to perform additional type checking in DEBUG builds.
+#if defined (_MSC_VER) && !defined(NDEBUG)
assert(f == NULL || dynamic_cast<To>(f) != NULL); // RTTI: debug mode only!
#endif
return static_cast<To>(f);