[Tux4kids-commits] r967 - in tuxmath/trunk: mingw src
B. Luchen
cheezmeister-guest at alioth.debian.org
Wed May 6 02:24:37 UTC 2009
Author: cheezmeister-guest
Date: 2009-05-06 02:24:37 +0000 (Wed, 06 May 2009)
New Revision: 967
Added:
tuxmath/trunk/mingw/config.h
Modified:
tuxmath/trunk/mingw/tuxmath.cbp
tuxmath/trunk/src/convert_utf.c
Log:
iconv and other tweaks for Vista MinGW build.
Added: tuxmath/trunk/mingw/config.h
===================================================================
--- tuxmath/trunk/mingw/config.h (rev 0)
+++ tuxmath/trunk/mingw/config.h 2009-05-06 02:24:37 UTC (rev 967)
@@ -0,0 +1,5 @@
+//ready-made config.h for a quick 'n dirty Windows build
+#define PACKAGE "tuxmath"
+#define PACKAGE_BUGREPORT "tuxmath-devel at lists.sourceforge.net"
+#define PACKAGE_NAME "Tux Of Math Command"
+
Modified: tuxmath/trunk/mingw/tuxmath.cbp
===================================================================
--- tuxmath/trunk/mingw/tuxmath.cbp 2009-04-28 16:04:16 UTC (rev 966)
+++ tuxmath/trunk/mingw/tuxmath.cbp 2009-05-06 02:24:37 UTC (rev 967)
@@ -16,9 +16,12 @@
<Add option="-g" />
<Add option="-DTUXMATH_DEBUG" />
<Add option="-DBUILD_MINGW32" />
+ <Add option="-DHAVE_STDINT_H" />
<Add option='-DPROGRAM_NAME=\"TuxMath\"' />
+ <Add option='-DPACKAGE=\"tuxmath\"' />
<Add option='-DDATA_PREFIX=\"../data\"' />
- <Add option='-DVERSION=\"1.6.3\"' />
+ <Add option='-DVERSION=\"1.7.2\"' />
+ <Add directory="." />
</Compiler>
</Target>
<Target title="WinRelease">
@@ -49,6 +52,10 @@
<Add option='-DDATA_PREFIX=\\"../data\\"' />
<Add option='-DLOCALEDIR=\\"/usr/local/share/locale\\"' />
</Compiler>
+ <Linker>
+ <Add library="SDL_Pango" />
+ <Add library="SDL_gfx" />
+ </Linker>
</Target>
<Target title="NixRelease">
<Option platforms="Unix;" />
@@ -74,11 +81,9 @@
</Compiler>
<Linker>
<Add library="SDL" />
- <Add library="SDL_gfx" />
<Add library="SDL_image" />
<Add library="SDL_mixer" />
<Add library="SDL_ttf" />
- <Add library="SDL_Pango" />
</Linker>
<Unit filename="../config.h" />
<Unit filename="../linebreak/lbrkprop.h" />
@@ -128,11 +133,13 @@
<Unit filename="../linebreak/xsize.h" />
<Unit filename="SDL_win32_main.c">
<Option compilerVar="CC" />
+ <Option target="WinRelease" />
<Option target="WinDebug" />
- <Option target="WinRelease" />
</Unit>
+ <Unit filename="config.h">
+ <Option target="WinDebug" />
+ </Unit>
<Unit filename="version.h">
- <Option target="WinRelease" />
<Option target="NixRelease" />
</Unit>
<Unit filename="../src/SDL_extras.c">
Modified: tuxmath/trunk/src/convert_utf.c
===================================================================
--- tuxmath/trunk/src/convert_utf.c 2009-04-28 16:04:16 UTC (rev 966)
+++ tuxmath/trunk/src/convert_utf.c 2009-05-06 02:24:37 UTC (rev 967)
@@ -1,5 +1,5 @@
/***************************************************************************
- convert_utf.c
+ convert_utf.c
-------------------
begin : Feb 08 2009
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <string.h>
-#include <iconv.h>
+#include <SDL.h>
#define UTF_BUF_LENGTH 1024
@@ -35,7 +35,7 @@
wchar_t temp_wchar[UTF_BUF_LENGTH];
wchar_t* wchar_start = temp_wchar;
- iconv_t conv_descr;
+ SDL_iconv_t conv_descr;
size_t bytes_converted;
size_t in_length = (size_t)UTF_BUF_LENGTH;
size_t out_length = (size_t)UTF_BUF_LENGTH;
@@ -52,16 +52,16 @@
/* NOTE although we *should* be just able to pass "wchar_t" as the out_type, */
/* iconv_open() segfaults on Windows if this is done - grrr.... */
#ifdef WIN32
- conv_descr = iconv_open("UTF-16LE", "UTF-8");
+ conv_descr = SDL_iconv_open("UTF-16LE", "UTF-8");
#else
- conv_descr = iconv_open("wchar_t", "UTF-8");
+ conv_descr = SDL_iconv_open("wchar_t", "UTF-8");
#endif
/* NOTE casts to prevent compiler warnings */
- bytes_converted = iconv(conv_descr,
+ bytes_converted = SDL_iconv(conv_descr,
(char**)&UTF8_word, &in_length,
(char**)&wchar_start, &out_length);
- iconv_close(conv_descr);
+ SDL_iconv_close(conv_descr);
wcsncpy(wide_word, temp_wchar, max_length);
tmdprintf("ConvertToUTF8(): wide_word = %S\n", wide_word);
@@ -86,7 +86,7 @@
/* into the argument UTF8_word string, but so far have had errors. */
char* UTF8_Start = temp_UTF8;
- iconv_t conv_descr;
+ SDL_iconv_t conv_descr;
size_t bytes_converted;
size_t in_length = (size_t)UTF_BUF_LENGTH;
size_t out_length = (size_t)UTF_BUF_LENGTH;
@@ -103,17 +103,17 @@
/* NOTE although we *should* be just able to pass "wchar_t" as the in_type, */
/* iconv_open() segfaults on Windows if this is done - grrr.... */
#ifdef WIN32
- conv_descr = iconv_open("UTF-8", "UTF-16LE");
+ conv_descr = SDL_iconv_open("UTF-8", "UTF-16LE");
#else
- conv_descr = iconv_open("UTF-8", "wchar_t");
+ conv_descr = SDL_iconv_open("UTF-8", "wchar_t");
#endif
/* NOTE casts to prevent compiler warnings. While the documentation for iconv() */
/* says arg 2 is a "const char**", it is "char**" in the iconv.h header itself. */
- bytes_converted = iconv(conv_descr,
+ bytes_converted = SDL_iconv(conv_descr,
(char**)&wide_word, &in_length,
(char**)&UTF8_Start, &out_length);
- iconv_close(conv_descr);
+ SDL_iconv_close(conv_descr);
strncpy(UTF8_word, temp_UTF8, max_length);
tmdprintf("ConvertToUTF8(): UTF8_word = %s\n", UTF8_word);
More information about the Tux4kids-commits
mailing list