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
This commit is contained in:
parent
430eab49b7
commit
51acfa41eb
2
CHANGES
2
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
|
||||
|
@ -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>
|
||||
|
17
src/fl_utf.c
17
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;
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user