Add and improve pragmas for MSVC compiler. * include/freetype/internal/ftdebug.h: Remove pragmas. * include/freetype/internal/ftserv.h: Use push and pop for pragmas. * include/freetype/internal/ftvalid.h: Handle warning C4324. * src/base/ftobjs.c: Use push and pop for pragmas. * src/gzip/ftgzip.c: Handle warning C4244.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
diff --git a/ChangeLog b/ChangeLog
index 8fddfb4..2472cfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2013-06-07 Werner Lemberg <wl@gnu.org>
+ Add and improve pragmas for MSVC compiler.
+
+ * include/freetype/internal/ftdebug.h: Remove pragmas.
+ * include/freetype/internal/ftserv.h: Use push and pop for pragmas.
+ * include/freetype/internal/ftvalid.h: Handle warning C4324.
+ * src/base/ftobjs.c: Use push and pop for pragmas.
+ * src/gzip/ftgzip.c: Handle warning C4244.
+
+2013-06-07 Werner Lemberg <wl@gnu.org>
+
[cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.
* src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h
index 095da1d..1ee120f 100644
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -248,15 +248,6 @@ FT_BEGIN_HEADER
ft_debug_init( void );
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
-
- /* We disable the warning `conditional expression is constant' here */
- /* in order to compile cleanly with the maximum level of warnings. */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
-
FT_END_HEADER
#endif /* __FTDEBUG_H__ */
diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
index 724e1f0..4ac988b 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -34,12 +34,12 @@
FT_BEGIN_HEADER
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
-
- /* we disable the warning `conditional expression is constant' here */
- /* in order to compile cleanly with the maximum level of warnings */
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `conditional expression is */
+ /* constant' in order to compile cleanly with the maximum */
+ /* level of warnings. */
+#pragma warning( push )
#pragma warning( disable : 4127 )
-
#endif /* _MSC_VER */
/*
@@ -763,6 +763,10 @@ FT_BEGIN_HEADER
/* */
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
FT_END_HEADER
#endif /* __FTSERV_H__ */
diff --git a/include/freetype/internal/ftvalid.h b/include/freetype/internal/ftvalid.h
index 00cd85e..12ad036 100644
--- a/include/freetype/internal/ftvalid.h
+++ b/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,6 +76,14 @@ FT_BEGIN_HEADER
} FT_ValidationLevel;
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `structure was padded due to */
+ /* __declspec(align())' in order to compile cleanly with */
+ /* the maximum level of warnings. */
+#pragma warning( push )
+#pragma warning( disable : 4324 )
+#endif /* _MSC_VER */
+
/* validator structure */
typedef struct FT_ValidatorRec_
{
@@ -88,8 +96,11 @@ FT_BEGIN_HEADER
} FT_ValidatorRec;
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
-#define FT_VALIDATOR( x ) ((FT_Validator)( x ))
+#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
FT_BASE( void )
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index b1fd844..401fd64 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -51,6 +51,7 @@
/* possible loss of data' in order to compile cleanly with */
/* the maximum level of warnings: `md5.c' is non-FreeType */
/* code, and it gets used during development builds only. */
+#pragma warning( push )
#pragma warning( disable : 4244 )
#endif /* _MSC_VER */
@@ -60,7 +61,7 @@
#undef free
#if defined( _MSC_VER )
-#pragma warning( default : 4244 )
+#pragma warning( pop )
#endif
#endif /* FT_DEBUG_LEVEL_TRACE */
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index c8cfb53..f267558 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -68,6 +68,15 @@
#undef SLOW
#define SLOW 1 /* we can't use asm-optimized sources here! */
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `conversion from XXX to YYY, */
+ /* possible loss of data' in order to compile cleanly with */
+ /* the maximum level of warnings: zlib is non-FreeType */
+ /* code. */
+#pragma warning( push )
+#pragma warning( disable : 4244 )
+#endif /* _MSC_VER */
+
/* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like
this. We temporarily disable it and load all necessary header files. */
#define NO_INFLATE_MASK
@@ -87,6 +96,10 @@
#include "inflate.c"
#include "adler32.c"
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */