Committing in .

Changes to make OpenVMS compile WX

 Modified Files:
 	wxWidgets/include/wx/wxcrt.h wxWidgets/include/wx/wxcrtbase.h
 	wxWidgets/src/common/wxcrt.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jouk Jansen
2007-06-15 12:52:25 +00:00
parent a33c7045d1
commit 28ffb1f22f
3 changed files with 45 additions and 10 deletions

View File

@@ -420,11 +420,12 @@ WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String)
// call in wxStrcoll_String<T>()), so we have to forward-declare the template // call in wxStrcoll_String<T>()), so we have to forward-declare the template
// and implement it below WX_STRCMP_FUNC. OTOH, this fails to compile with VC6, // and implement it below WX_STRCMP_FUNC. OTOH, this fails to compile with VC6,
// so we do it for GCC only. // so we do it for GCC only.
#ifdef __GNUG__ // The same is needed for HP CXX on OpenVMS
#if defined( __GNUG__ ) || defined( __VMS )
template<typename T> template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2); inline int wxStrcoll_String(const wxString& s1, const T& s2);
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String) WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif // __GNUG__ #endif // __GNUG__ or __VMS
template<typename T> template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2) inline int wxStrcoll_String(const wxString& s1, const T& s2)
@@ -440,7 +441,7 @@ inline int wxStrcoll_String(const wxString& s1, const T& s2)
#endif #endif
} }
#ifndef __GNUG__ #if !defined( __GNUG__ ) && !defined( __VMS )
// this is exactly the same WX_STRCMP_FUNC line as above wxStrcoll_String<> // this is exactly the same WX_STRCMP_FUNC line as above wxStrcoll_String<>
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String) WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif #endif

View File

@@ -174,7 +174,7 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
/* Almost all compiler have strdup(), but not quite all: CodeWarrior under /* Almost all compiler have strdup(), but not quite all: CodeWarrior under
Mac and VC++ for Windows CE don't provide it; additionally, gcc under Mac and VC++ for Windows CE don't provide it; additionally, gcc under
Mac doesn't have wcsdup: */ Mac and OpenVMS do not have wcsdup: */
#if defined(__VISUALC__) && __VISUALC__ >= 1400 #if defined(__VISUALC__) && __VISUALC__ >= 1400
#define wxCRT_StrdupA _strdup #define wxCRT_StrdupA _strdup
#elif !(defined(__MWERKS__) && defined(__WXMAC__)) && !defined(__WXWINCE__) #elif !(defined(__MWERKS__) && defined(__WXMAC__)) && !defined(__WXWINCE__)
@@ -182,7 +182,7 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
#endif #endif
#if defined(__WINDOWS__) #if defined(__WINDOWS__)
#define wxCRT_StrdupW _wcsdup #define wxCRT_StrdupW _wcsdup
#elif !defined(__DARWIN__) #elif !defined(__DARWIN__) && !defined( __VMS )
#define wxCRT_StrdupW wcsdup #define wxCRT_StrdupW wcsdup
#endif #endif
#else #else
@@ -541,7 +541,9 @@ WXDLLIMPEXP_BASE wchar_t * wxCRT_GetenvW(const wchar_t *name);
#define wxCRT_AtolW _wtol #define wxCRT_AtolW _wtol
/* _wtof doesn't exist */ /* _wtof doesn't exist */
#else #else
#ifndef __VMS
#define wxCRT_AtofW(s) wcstof(s, NULL) #define wxCRT_AtofW(s) wcstof(s, NULL)
#endif
#define wxCRT_AtolW(s) wcstol(s, NULL, 10) #define wxCRT_AtolW(s) wcstol(s, NULL, 10)
/* wcstoi doesn't exist */ /* wcstoi doesn't exist */
#endif #endif

View File

@@ -600,8 +600,16 @@ int wxCRT_ScanfW(const wchar_t *format, ...)
va_list argptr; va_list argptr;
va_start(argptr, format); va_start(argptr, format);
int ret = vwscanf(wxFormatConverter(format), argptr); #ifdef __VMS
#if (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD )
int ret = std::vwscanf(wxFormatConverter(format), argptr);
#else
int ret = vwscanf(wxFormatConverter(format), argptr);
#endif
#else
int ret = vwscanf(wxFormatConverter(format), argptr);
#endif
va_end(argptr); va_end(argptr);
return ret; return ret;
@@ -614,7 +622,15 @@ int wxCRT_SscanfW(const wchar_t *str, const wchar_t *format, ...)
va_list argptr; va_list argptr;
va_start(argptr, format); va_start(argptr, format);
int ret = vswscanf(str, wxFormatConverter(format), argptr); #ifdef __VMS
#if (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD )
int ret = std::vswscanf(str, wxFormatConverter(format), argptr);
#else
int ret = vswscanf(str, wxFormatConverter(format), argptr);
#endif
#else
int ret = vswscanf(str, wxFormatConverter(format), argptr);
#endif
va_end(argptr); va_end(argptr);
@@ -627,7 +643,15 @@ int wxCRT_FscanfW(FILE *stream, const wchar_t *format, ...)
{ {
va_list argptr; va_list argptr;
va_start(argptr, format); va_start(argptr, format);
int ret = vfwscanf(stream, wxFormatConverter(format), argptr); #ifdef __VMS
#if (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD )
int ret = std::vfwscanf(stream, wxFormatConverter(format), argptr);
#else
int ret = vfwscanf(stream, wxFormatConverter(format), argptr);
#endif
#else
int ret = vfwscanf(stream, wxFormatConverter(format), argptr);
#endif
va_end(argptr); va_end(argptr);
@@ -638,7 +662,15 @@ int wxCRT_FscanfW(FILE *stream, const wchar_t *format, ...)
#ifndef wxCRT_VsscanfW #ifndef wxCRT_VsscanfW
int wxCRT_VsscanfW(const wchar_t *str, const wchar_t *format, va_list argptr) int wxCRT_VsscanfW(const wchar_t *str, const wchar_t *format, va_list argptr)
{ {
return vswscanf(str, wxFormatConverter(format), argptr); #ifdef __VMS
#if (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD )
return std::vswscanf(str, wxFormatConverter(format), argptr);
#else
return vswscanf(str, wxFormatConverter(format), argptr);
#endif
#else
return vswscanf(str, wxFormatConverter(format), argptr);
#endif
} }
#endif #endif