From: Robert Roebling Date: Sat, 7 Dec 2002 15:41:13 +0000 (+0000) Subject: Various compile fixes for WinCE. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0e0126c2204732b9dfeefef0de838d7d375cf1f0 Various compile fixes for WinCE. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/buffer.h b/include/wx/buffer.h index b913e75100..17fd98fff2 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -95,6 +95,19 @@ private: \ chartype *m_str; \ } +#ifndef strdup +inline char *strdup(const char *cs) +{ + size_t len = 0; + while (cs[len] != 0) + len++; + const size_t siz = (len + 1)*sizeof(char); + char *csCopy = (char *)malloc(siz); + memcpy(csCopy, cs, siz); + return csCopy; +} +#endif + DEFINE_BUFFER(wxCharBuffer, char, strdup); #if wxUSE_WCHAR_T diff --git a/include/wx/debug.h b/include/wx/debug.h index 49a15d363b..ba28e3ca0c 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -12,7 +12,9 @@ #ifndef _WX_DEBUG_H_ #define _WX_DEBUG_H_ +#ifndef __WXWINCE__ #include +#endif #include // for CHAR_BIT used below #include "wx/wxchar.h" // for __TFILE__ and wxChar diff --git a/include/wx/defs.h b/include/wx/defs.h index 5482b48848..e98d4a5498 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -95,7 +95,7 @@ // compiler defects workarounds // ---------------------------------------------------------------------------- -#if defined(__VISUALC__) && !defined(WIN32) +#if defined(__VISUALC__) && !defined(WIN32) && !defined(__WXWINCE__) // VC1.5 does not have LPTSTR type #define LPTSTR LPSTR #define LPCTSTR LPCSTR diff --git a/include/wx/filefn.h b/include/wx/filefn.h index b6d2f0087f..f679c61145 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -18,12 +18,18 @@ #include "wx/list.h" +#ifndef __WXWINCE__ #include +#endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- +#ifdef __WXWINCE__ + typedef long off_t; +#else + // define off_t #if !defined(__WXMAC__) || defined(__UNIX__) #include @@ -41,6 +47,8 @@ typedef long off_t; #endif +#endif + #if defined(__VISAGECPP__) && __IBMCPP__ >= 400 // // VisualAge C++ V4.0 cannot have any external linkage const decs diff --git a/include/wx/log.h b/include/wx/log.h index a93daa1585..f4b5163c2b 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -40,7 +40,9 @@ typedef unsigned long wxLogLevel; #if wxUSE_LOG +#ifndef __WXWINCE__ #include // for time_t +#endif #include "wx/dynarray.h"