]> git.lyx.org Git - features.git/commitdiff
test for the size of wchar_t and define the macro SIZEOF_WCHAR_T with the size
authorPeter Kümmel <syntheticpp@gmx.net>
Wed, 13 Sep 2006 21:45:52 +0000 (21:45 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Wed, 13 Sep 2006 21:45:52 +0000 (21:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14992 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/ConfigureChecks.cmake
development/cmake/config.h.cmake

index c6b924ce1220379ed42ba1ce7b9b3882e9d689cc..85a6323895e704d6da989d47d6044a23c69d84de 100644 (file)
@@ -124,6 +124,20 @@ check_cxx_source_compiles(
        "
 HAVE_ICONV_CONST)
 
+check_cxx_source_compiles(
+       "
+       int i[ ( sizeof(wchar_t)==2 ? 1 : -1 ) ];
+       int main(){return 0;}
+       "
+SIZEOF_WCHAR_T_IS_2)
+
+check_cxx_source_compiles(
+       "
+       int i[ ( sizeof(wchar_t)==4 ? 1 : -1 ) ];
+       int main(){return 0;}
+       "
+SIZEOF_WCHAR_T_IS_4)
+
 set(PACKAGE lyx)
 set(PACKAGE_VERSION 1.5.0svn)
 
index eb0ec2469fc213d955a82fa98306567ed4900001..4a2db7bd513208b4c2916010ec9b569808bcb812 100644 (file)
 #cmakedefine HAVE_LC_MESSAGES 1    
 #cmakedefine HAVE_SSTREAM 1
 #cmakedefine HAVE_ARGZ_H 1
+#cmakedefine SIZEOF_WCHAR_T_IS_2 1
+#cmakedefine SIZEOF_WCHAR_T_IS_4 1
+
+#ifdef SIZEOF_WCHAR_T_IS_2
+#  define SIZEOF_WCHAR_T 2
+#else
+#  ifdef SIZEOF_WCHAR_T_IS_4
+#    define SIZEOF_WCHAR_T 4
+#  endif
+#endif
 
 #cmakedefine HAVE_ALLOCA 1
 #cmakedefine HAVE_SYMBOL_ALLOCA 1