[Pcre-svn] [1199] code/trunk/pcre_internal.h: Fix compile-ti…

Kezdőlap
Üzenet törlése
Szerző: Subversion repository
Dátum:  
Címzett: pcre-svn
Tárgy: [Pcre-svn] [1199] code/trunk/pcre_internal.h: Fix compile-time assertion to test the right thing
Revision: 1199
          http://vcs.pcre.org/viewvc?view=rev&revision=1199
Author:   chpe
Date:     2012-11-03 19:21:37 +0000 (Sat, 03 Nov 2012)


Log Message:
-----------
Fix compile-time assertion to test the right thing

The assertion needs to test that the *public* definition of the 32-bit character
is a 32-bit integer type, not the *private* definition.

Modified Paths:
--------------
    code/trunk/pcre_internal.h


Modified: code/trunk/pcre_internal.h
===================================================================
--- code/trunk/pcre_internal.h    2012-11-01 19:23:35 UTC (rev 1198)
+++ code/trunk/pcre_internal.h    2012-11-03 19:21:37 UTC (rev 1199)
@@ -279,9 +279,6 @@
 #define MAX_255(c) ((c) <= 255u)
 #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))


-/* Assert that pcre_uchar32 is a 32-bit type */
-typedef int __assert_pcre_uchar32_size[sizeof(pcre_uchar) == 4 ? 1 : -1];
-
#else
#error Unsupported compiling mode
#endif /* COMPILE_PCRE[8|16|32] */
@@ -351,6 +348,11 @@
#include "pcre.h"
#include "ucp.h"

+#ifdef COMPILE_PCRE32
+/* Assert that the public PCRE_UCHAR32 is a 32-bit type */
+typedef int __assert_pcre_uchar32_size[sizeof(PCRE_UCHAR32) == 4 ? 1 : -1];
+#endif
+
/* When compiling for use with the Virtual Pascal compiler, these functions
need to have their names changed. PCRE must be compiled with the -DVPCOMPAT
option on the command line. */