I wanted to use SILLY on wince but on this platform strings are natively unicode and I find it stupid to always convert it to ANSI while it would be so simple to add UNICODE.
Why don't you declare a SillyTchar.h defined like this :
Code: Select all
#ifndef SILLYTCHAR_H
#define SILLYTCHAR_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32) || defined(_WIN32_WCE)
#include <stdio.h>
#include <tchar.h>
// _T("") macro is defined in tchar.h
#else
// On other systems we use ANSI
#define _T(x) x
#define _tmain main
#define _tWinMain WinMain
#ifdef _POSIX_
#define _tenviron environ
#else
#define _tenviron _environ
#endif
#define __targv __argv
#define _tcsclen strlen
#define _topen open
....
#endif
#ifdef __cplusplus
}
#endif
#endif // SILLYTCHAR_H
And in functions needing strings :
DevILImageCodec::DevILImageCodec()
: ImageCodec("DevILImageCodec - Official DevIL based image codec")
should be replaced by:
DevILImageCodec::DevILImageCodec()
: ImageCodec(_T("DevILImageCodec - Official DevIL based image codec"))
{
}
On Windows and Windows CE, _T("") is defined and on other system (linux, BSD, ...) we use standard ansi functions.
I have never understood why open source project don't rely on this ?
Then replace char* by TCHAR* or if u don't like this naming you could decalre a SILTCHAR for instance