summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-01-23 13:48:50 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-01-23 13:48:50 +0000
commit51acfa41eb2e0a823fc22ca76514a56ea0e152ae (patch)
treeb51d3528c55097738971fff7a08bc9916d1bad93
parent430eab49b773887a45c3a231472ee203abd8602b (diff)
Replaced _WIN32 symbols that had crept in with UTF-8 and the
new Fl_Table widget with WIN32. Todo: check, if the conditional in test/table.cxx is useful at all git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7022 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--FL/Fl_Table.H6
-rw-r--r--src/fl_utf.c17
-rw-r--r--test/table.cxx4
-rw-r--r--test/utf8.cxx4
5 files changed, 17 insertions, 16 deletions
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 <sys/types.h>
#include <string.h> // memcpy
-#ifdef _WIN32
+#ifdef WIN32
#include <malloc.h> // WINDOWS: malloc/realloc
-#else /*_WIN32*/
+#else /*WIN32*/
#include <stdlib.h> // UNIX: malloc/realloc
-#endif /*_WIN32*/
+#endif /*WIN32*/
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
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 <windows.h>
#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 <stdio.h>
#include <string.h>
-#ifdef _WIN32
+#ifdef WIN32
#include <stdlib.h> // atoi
-#endif /*_WIN32*/
+#endif /*WIN32*/
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
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"