From: Peter Kümmel Date: Wed, 13 Sep 2006 21:45:52 +0000 (+0000) Subject: test for the size of wchar_t and define the macro SIZEOF_WCHAR_T with the size X-Git-Tag: 1.6.10~12582 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d6cc4b9f0b7e38a0311b4973bd2da26327aa93ea;p=features.git test for the size of wchar_t and define the macro SIZEOF_WCHAR_T with the size git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14992 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/cmake/ConfigureChecks.cmake b/development/cmake/ConfigureChecks.cmake index c6b924ce12..85a6323895 100644 --- a/development/cmake/ConfigureChecks.cmake +++ b/development/cmake/ConfigureChecks.cmake @@ -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) diff --git a/development/cmake/config.h.cmake b/development/cmake/config.h.cmake index eb0ec2469f..4a2db7bd51 100644 --- a/development/cmake/config.h.cmake +++ b/development/cmake/config.h.cmake @@ -83,6 +83,16 @@ #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