diff --git a/CHANGES b/CHANGES index 5ebbfceae..d03f28ff7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES IN FLTK 1.3.0 + - Replaced _WIN32 symbols that had come with UTF-8 and the + new Fl_Table widget with WIN32 - Fixed a buffer overflow in fl_utf8from_mb() (STR #2279) - Fixed a Windows GDI leak when testing alpha blending capabilities - Fixed a name conflict with new (VS 2008 Express) winsock2.h diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index e28d050d9..4190a4b11 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -33,11 +33,11 @@ #include #include // memcpy -#ifdef _WIN32 +#ifdef WIN32 #include // WINDOWS: malloc/realloc -#else /*_WIN32*/ +#else /*WIN32*/ #include // UNIX: malloc/realloc -#endif /*_WIN32*/ +#endif /*WIN32*/ #include #include diff --git a/src/fl_utf.c b/src/fl_utf.c index eb130b4bf..b5b2a53ac 100644 --- a/src/fl_utf.c +++ b/src/fl_utf.c @@ -415,7 +415,7 @@ unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned fl_utf8towc(const char* src, unsigned srclen, wchar_t* dst, unsigned dstlen) { -#ifdef _WIN32 +#ifdef WIN32 return fl_utf8toUtf16(src, srclen, (unsigned short*)dst, dstlen); #else const char* p = src; @@ -541,7 +541,7 @@ unsigned fl_utf8fromwc(char* dst, unsigned dstlen, if (count+2 >= dstlen) {dst[count] = 0; count += 2; break;} dst[count++] = 0xc0 | (ucs >> 6); dst[count++] = 0x80 | (ucs & 0x3F); -#ifdef _WIN32 +#ifdef WIN32 } else if (ucs >= 0xd800 && ucs <= 0xdbff && i < srclen && src[i] >= 0xdc00 && src[i] <= 0xdfff) { /* surrogate pair */ @@ -561,7 +561,7 @@ unsigned fl_utf8fromwc(char* dst, unsigned dstlen, dst[count++] = 0x80 | ((ucs >> 6) & 0x3F); dst[count++] = 0x80 | (ucs & 0x3F); } else { -#ifndef _WIN32 +#ifndef WIN32 J1: #endif /* all others are 3 bytes: */ @@ -578,7 +578,7 @@ unsigned fl_utf8fromwc(char* dst, unsigned dstlen, count++; } else if (ucs < 0x800U) { /* 2 bytes */ count += 2; -#ifdef _WIN32 +#ifdef WIN32 } else if (ucs >= 0xd800 && ucs <= 0xdbff && i < srclen-1 && src[i+1] >= 0xdc00 && src[i+1] <= 0xdfff) { /* surrogate pair */ @@ -644,7 +644,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen, return count; } -#ifdef _WIN32 +#ifdef WIN32 # include #endif @@ -663,7 +663,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen, int fl_utf8locale(void) { static int ret = 2; if (ret == 2) { -#ifdef _WIN32 +#ifdef WIN32 ret = GetACP() == CP_UTF8; #else char* s; @@ -699,7 +699,7 @@ unsigned fl_utf8to_mb(const char* src, unsigned srclen, char* dst, unsigned dstlen) { if (!fl_utf8locale()) { -#ifdef _WIN32 +#ifdef WIN32 wchar_t lbuf[1024]; wchar_t* buf = lbuf; unsigned length = fl_utf8towc(src, srclen, buf, 1024); @@ -775,8 +775,7 @@ unsigned fl_utf8from_mb(char* dst, unsigned dstlen, const char* src, unsigned srclen) { if (!fl_utf8locale()) { -#ifdef _WIN32 -#warning _WIN32 alarm +#ifdef WIN32 wchar_t lbuf[1024]; wchar_t* buf = lbuf; unsigned length; diff --git a/test/table.cxx b/test/table.cxx index 52e2cf794..ec94314c6 100644 --- a/test/table.cxx +++ b/test/table.cxx @@ -4,9 +4,9 @@ #include #include -#ifdef _WIN32 +#ifdef WIN32 #include // atoi -#endif /*_WIN32*/ +#endif /*WIN32*/ #include #include diff --git a/test/utf8.cxx b/test/utf8.cxx index ee418b44b..9c0f7ac76 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -383,7 +383,7 @@ int make_font_chooser(void) // Load the systems available fonts - ask for everything // font_count = Fl::set_fonts("*"); -#ifdef _WIN32 +#ifdef WIN32 font_count = Fl::set_fonts("*"); #elif __APPLE__ font_count = Fl::set_fonts("*"); @@ -539,7 +539,7 @@ int main(int argc, char** argv) /* setup the extra font */ Fl::set_font(extra_font, -#ifdef _WIN32 +#ifdef WIN32 " Arial Unicode MS" #elif __APPLE__ "Monaco"