From 22a351211027f1091b7eb8594a1127c3328109a2 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Tue, 15 Aug 2006 14:23:57 +0000 Subject: [PATCH] Scons: fix ICONV support git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14690 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/scons/SConstruct | 6 +++--- development/scons/scons_utils.py | 21 +++++---------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/development/scons/SConstruct b/development/scons/SConstruct index 6e3c515904..5ac2f53f8f 100644 --- a/development/scons/SConstruct +++ b/development/scons/SConstruct @@ -1049,8 +1049,8 @@ int count() (conf.CheckIconvConst(), 'ICONV_CONST', 'Define as const if the declaration of iconv() needs const.', - '#define ICONV_CONST', '#define ICONV_CONST const', + '#define ICONV_CONST', ), (conf.CheckLC_MESSAGES(), 'HAVE_LC_MESSAGES', @@ -1232,8 +1232,8 @@ int mkstemp(char*); (conf.CheckIconvConst(), 'ICONV_CONST', 'Define as const if the declaration of iconv() needs const.', - '#define ICONV_CONST', '#define ICONV_CONST const', + '#define ICONV_CONST', ), (conf.CheckType('intmax_t', includes='#include ') or \ conf.CheckType('intmax_t', includes='#include '), @@ -1246,7 +1246,7 @@ int mkstemp(char*); ), ], extra_items = [ - ('#define HAVE_ICONV', 'Define if iconv or libiconv is found') + ('#define HAVE_ICONV 1', 'Define if iconv or libiconv is found') ], config_post = '#endif' ) diff --git a/development/scons/scons_utils.py b/development/scons/scons_utils.py index 3659337f27..e6c6aded65 100644 --- a/development/scons/scons_utils.py +++ b/development/scons/scons_utils.py @@ -241,23 +241,12 @@ int main() def checkIconvConst(conf): ''' check the declaration of iconv ''' check_iconv_const = ''' -#include #include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -#ifndef LIBICONV_DLL_EXPORTED -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#endif -#else -size_t iconv(); -#endif - -int main() -{ - return 1; +// this declaration will fail when there already exists a non const char** +// version which returns size_t +double iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +int main() { + return 0; } ''' conf.Message('Check if the declaration of iconv needs const... ')