From 9b4da62701dbe8ccfbe447ce8d1bc77fcb40e9e5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Mar 2008 00:43:06 +0000 Subject: [PATCH] PalmOS compilation fixes (wx-trunk-out.diff part of patch 1894861) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/bmpbuttn.h | 2 ++ include/wx/buffer.h | 2 ++ include/wx/choice.h | 2 ++ include/wx/datetime.h | 10 +++++----- include/wx/debug.h | 2 ++ include/wx/dirdlg.h | 1 + include/wx/filectrl.h | 2 +- include/wx/filefn.h | 37 +++++++++++++++++++++++++++++++++++++ include/wx/imaglist.h | 4 +++- include/wx/log.h | 2 ++ include/wx/strconv.h | 2 ++ include/wx/string.h | 6 ++---- include/wx/textctrl.h | 2 ++ include/wx/wxcrtbase.h | 2 ++ src/common/appbase.cpp | 2 ++ src/common/file.cpp | 2 ++ src/common/log.cpp | 2 ++ src/common/stopwatch.cpp | 3 +++ src/common/utilscmn.cpp | 4 ++++ 19 files changed, 78 insertions(+), 11 deletions(-) diff --git a/include/wx/bmpbuttn.h b/include/wx/bmpbuttn.h index 990f3f3842..27edd94fd0 100644 --- a/include/wx/bmpbuttn.h +++ b/include/wx/bmpbuttn.h @@ -115,6 +115,8 @@ inline void wxBitmapButtonBase::SetLabel(const wxBitmap& bitmap) #include "wx/cocoa/bmpbuttn.h" #elif defined(__WXPM__) #include "wx/os2/bmpbuttn.h" +#elif defined(__WXPALMOS__) + #include "wx/palmos/bmpbuttn.h" #endif #endif // wxUSE_BMPBUTTON diff --git a/include/wx/buffer.h b/include/wx/buffer.h index d06fbf6fc1..346ef113f9 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -15,7 +15,9 @@ #include "wx/chartype.h" #include "wx/wxcrtbase.h" +#ifndef __WXPALMOS5__ #include // malloc() and free() +#endif // ! __WXPALMOS5__ class WXDLLIMPEXP_FWD_BASE wxCStrData; diff --git a/include/wx/choice.h b/include/wx/choice.h index 69cab9702e..3127b083a5 100644 --- a/include/wx/choice.h +++ b/include/wx/choice.h @@ -84,6 +84,8 @@ private: #include "wx/cocoa/choice.h" #elif defined(__WXPM__) #include "wx/os2/choice.h" +#elif defined(__WXPALMOS__) + #include "wx/palmos/choice.h" #endif #endif // wxUSE_CHOICE diff --git a/include/wx/datetime.h b/include/wx/datetime.h index a18dad3cc5..7677de54ed 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -17,11 +17,11 @@ #if wxUSE_DATETIME -#ifndef __WXWINCE__ -#include -#else -#include "wx/msw/wince/time.h" -#endif +#ifdef __WXWINCE__ + #include "wx/msw/wince/time.h" +#elif !defined(__WXPALMOS5__) + #include +#endif // OS #include // for INT_MIN diff --git a/include/wx/debug.h b/include/wx/debug.h index 936755e71b..4d678a7770 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -14,9 +14,11 @@ #ifndef _WX_DEBUG_H_ #define _WX_DEBUG_H_ +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include #endif +#endif // ! __WXPALMOS5__ #include /* for CHAR_BIT used below */ #include "wx/chartype.h" /* for __TFILE__ and wxChar */ diff --git a/include/wx/dirdlg.h b/include/wx/dirdlg.h index d54eb6ff8e..4258accb07 100644 --- a/include/wx/dirdlg.h +++ b/include/wx/dirdlg.h @@ -118,6 +118,7 @@ protected: defined(__WXX11__) || \ defined(__WXMGL__) || \ defined(__WXCOCOA__) || \ + defined(__WXPALMOS__) || \ defined(__WXPM__) #include "wx/generic/dirdlgg.h" // Other ports use generic implementation #define wxDirDialog wxGenericDirDialog diff --git a/include/wx/filectrl.h b/include/wx/filectrl.h index f8320f9aaf..ad22cebdcf 100644 --- a/include/wx/filectrl.h +++ b/include/wx/filectrl.h @@ -29,7 +29,7 @@ enum }; #define wxFC_DEFAULT_STYLE wxFC_OPEN -extern WXDLLEXPORT_DATA( const wxChar ) wxFileCtrlNameStr[]; +extern WXDLLEXPORT_DATA( const wxChar ) wxFileCtrlNameStr[]; // in filectrlcmn.cpp extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_SELECTIONCHANGED; extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_FILEACTIVATED; diff --git a/include/wx/filefn.h b/include/wx/filefn.h index a44970676f..3c69ff0758 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -385,6 +385,43 @@ enum wxFileKind // it's a private define, undefine it so that nobody gets tempted to use it #undef wxHAS_HUGE_FILES +#elif defined (__WXPALMOS__) + typedef off_t wxFileOffset; +#ifdef _LARGE_FILES + #define wxFileOffsetFmtSpec wxLongLongFmtSpec + wxCOMPILE_TIME_ASSERT( sizeof(off_t) == sizeof(wxLongLong_t), BadFileSizeType ); + // wxFile is present and supports large files + #ifdef wxUSE_FILE + #define wxHAS_LARGE_FILES + #endif + // wxFFile is present and supports large files + #if SIZEOF_LONG == 8 || defined HAVE_FSEEKO + #define wxHAS_LARGE_FFILES + #endif +#else + #define wxFileOffsetFmtSpec _T("") +#endif + #define wxClose close + #define wxRead ::read + #define wxWrite ::write + #define wxLseek lseek + #define wxSeek lseek + #define wxFsync fsync + #define wxEof eof + + #define wxCRT_MkDir mkdir + #define wxCRT_RmDir rmdir + + #define wxTell(fd) lseek(fd, 0, SEEK_CUR) + + #define wxStructStat struct stat + + #define wxCRT_Open open + #define wxCRT_Stat svfs_stat + #define wxCRT_Lstat lstat + #define wxCRT_Access access + + #define wxHAS_NATIVE_LSTAT #else // Unix or Windows using unknown compiler, assume POSIX supported typedef off_t wxFileOffset; #ifdef _LARGE_FILES diff --git a/include/wx/imaglist.h b/include/wx/imaglist.h index f4468e216f..2779e3f1e5 100644 --- a/include/wx/imaglist.h +++ b/include/wx/imaglist.h @@ -40,7 +40,7 @@ enum #define wxIMAGELIST_DRAW_SELECTED 0x0004 #define wxIMAGELIST_DRAW_FOCUSED 0x0008 -#if defined(__WXMSW__) || defined(__WXMAC__) +#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPALMOS__) #define wxHAS_NATIVE_IMAGELIST #endif @@ -50,6 +50,8 @@ enum #include "wx/msw/imaglist.h" #elif defined(__WXMAC__) #include "wx/mac/imaglist.h" +#elif defined(__WXPALMOS__) + #include "wx/palmos/imaglist.h" #endif #endif // _WX_IMAGLIST_H_BASE_ diff --git a/include/wx/log.h b/include/wx/log.h index a4d800e623..4d95236042 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -55,9 +55,11 @@ typedef unsigned long wxLogLevel; #include "wx/arrstr.h" +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include // for time_t #endif +#endif // ! __WXPALMOS5__ #include "wx/dynarray.h" diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 96dc8d8a70..e78282f922 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -25,7 +25,9 @@ # undef __BSEXCPT__ #endif +#ifndef __WXPALMOS5__ #include +#endif // ! __WXPALMOS5__ #if wxUSE_WCHAR_T diff --git a/include/wx/string.h b/include/wx/string.h index deecb1795b..f3afbd34ff 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -24,6 +24,7 @@ #include "wx/defs.h" // everybody should include this +#ifndef __WXPALMOS5__ #if defined(__WXMAC__) || defined(__VISAGECPP__) #include #endif @@ -46,10 +47,7 @@ #ifdef HAVE_STRCASECMP_IN_STRINGS_H #include // for strcasecmp() #endif // HAVE_STRCASECMP_IN_STRINGS_H - -#ifdef __WXPALMOS__ - #include -#endif +#endif // ! __WXPALMOS5__ #include "wx/wxcrtbase.h" // for wxChar, wxStrlen() etc. #include "wx/strvararg.h" diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index f0e93fc0db..b86137bc11 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -697,6 +697,8 @@ protected: #include "wx/cocoa/textctrl.h" #elif defined(__WXPM__) #include "wx/os2/textctrl.h" +#elif defined(__WXPALMOS__) + #include "wx/palmos/textctrl.h" #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/wxcrtbase.h b/include/wx/wxcrtbase.h index f69584b836..a48756a431 100644 --- a/include/wx/wxcrtbase.h +++ b/include/wx/wxcrtbase.h @@ -594,8 +594,10 @@ WXDLLIMPEXP_BASE wchar_t * wxCRT_GetenvW(const wchar_t *name); ------------------------------------------------------------------------- */ #define wxCRT_StrftimeA strftime +#ifndef __WXPALMOS__ /* FIXME-UTF8: when is this available? */ #define wxCRT_StrftimeW wcsftime +#endif /* ! __WXPALMOS__ */ #ifndef wxCRT_StrftimeW WXDLLIMPEXP_BASE size_t wxCRT_StrftimeW(wchar_t *s, size_t max, diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index e7eec2c75e..857b157822 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -51,11 +51,13 @@ #include #endif +#ifndef __WXPALMOS5__ #if !defined(__WXMSW__) || defined(__WXMICROWIN__) #include // for SIGTRAP used by wxTrap() #endif //Win/Unix #include +#endif // ! __WXPALMOS5__ #if wxUSE_FONTMAP #include "wx/fontmap.h" diff --git a/src/common/file.cpp b/src/common/file.cpp index abcf92a78c..a6d96d6a8e 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -80,6 +80,8 @@ char* mktemp( char * path ) { return path ;} #include #include +#elif defined(__WXPALMOS__) + #include "wx/palmos/missing.h" #else #error "Please specify the header with file functions declarations." #endif //Win/UNIX diff --git a/src/common/log.cpp b/src/common/log.cpp index 262477de40..ddb361a254 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -51,11 +51,13 @@ #include +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include #else #include "wx/msw/wince/time.h" #endif +#endif /* ! __WXPALMOS5__ */ #if defined(__WINDOWS__) #include "wx/msw/private.h" // includes windows.h diff --git a/src/common/stopwatch.cpp b/src/common/stopwatch.cpp index 5a3776da28..22ecaadecd 100644 --- a/src/common/stopwatch.cpp +++ b/src/common/stopwatch.cpp @@ -58,12 +58,15 @@ # undef HAVE_GETTIMEOFDAY #endif +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include #else #include "wx/msw/private.h" #include "wx/msw/wince/time.h" #endif +#endif // __WXPALMOS5__ + #if !defined(__WXMAC__) && !defined(__WXWINCE__) #include // for time_t diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index e656559ad2..c3b7898538 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -75,11 +75,13 @@ #include "wx/statusbr.h" #endif // wxUSE_GUI +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include #else #include "wx/msw/wince/time.h" #endif +#endif // ! __WXPALMOS5__ #ifdef __WXMAC__ #include "wx/mac/private.h" @@ -88,10 +90,12 @@ #endif #endif +#ifndef __WXPALMOS5__ #if !defined(__MWERKS__) && !defined(__WXWINCE__) #include #include #endif +#endif // ! __WXPALMOS5__ #if defined(__WXMSW__) #include "wx/msw/private.h" -- 2.45.2