// Microsoft compiler loves underscores, feed them to it
#if defined( __VISUALC__ ) \
|| ( defined(__MINGW32__) && !defined(__WINE__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
- || ( defined(__MWERKS__) && defined(__WXMSW__) )
+ || ( defined(__MWERKS__) && defined(__WXMSW__) ) \
+ || ( defined(__WATCOMC__) && defined(__WXMSW__) )
// functions
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(__WATCOMC__)
#define _tell tell
#endif
#define wxClose _close
#endif
#define wxAccess _access
#define wxMkDir _mkdir
+#ifdef __WATCOMC__
+ #define wxRmDir rmdir
+#else
#define wxRmDir _rmdir
+#endif
#define wxStat _stat
#endif
// types
+#if defined(__WATCOMC__)&& wxUSE_UNICODE
+ #define wxStructStat struct _wstat
+#else
#define wxStructStat struct _stat
+#endif
// constants (unless already defined by the user code)
- #if !defined(O_RDONLY) && !defined(__BORLANDC__)
+ #if !defined(O_RDONLY) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR
#define O_BINARY _O_BINARY
#endif
- #ifndef __BORLANDC__
+ #if !defined(__BORLANDC__) && !defined(__WATCOMC__)
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFREG _S_IFREG
WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf );
WXDLLIMPEXP_BASE int wxAccess( const wxChar *pathname, int mode );
WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode );
-#else
-#if defined(__WXMAC__) && !defined(__DARWIN__)
-#include <sys/stat.h>
-WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf );
-WXDLLIMPEXP_BASE int wxAccess( const wxChar *pathname, int mode );
-WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode );
#else
#define wxOpen open
#define wxStat stat
#define wxAccess access
#endif
-#endif
#endif // VC++
#define wxPATH_SEP_MAC wxT(";")
// platform independent versions
-#if defined(__UNIX__) && !defined(__CYGWIN__)
+#if defined(__UNIX__) && !defined(__CYGWIN__) && !defined(__OS2__)
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
#define wxPATH_SEP wxPATH_SEP_UNIX
#elif defined(__MAC__)
// this is useful for wxString::IsSameAs(): to compare two file names use
// filename1.IsSameAs(filename2, wxARE_FILENAMES_CASE_SENSITIVE)
-#if defined(__UNIX__) && !defined(__DARWIN__)
+#if defined(__UNIX__) && !defined(__DARWIN__) && !defined(__OS2__)
#define wxARE_FILENAMES_CASE_SENSITIVE TRUE
#else // Windows, Mac OS and OS/2
#define wxARE_FILENAMES_CASE_SENSITIVE FALSE
inline bool wxIsPathSeparator(wxChar c)
{
// under DOS/Windows we should understand both Unix and DOS file separators
-#if defined(__UNIX__) || defined(__MAC__)
+#if ( defined(__UNIX__) && !defined(__OS2__) )|| defined(__MAC__)
return c == wxFILE_SEP_PATH;
#else
return c == wxFILE_SEP_PATH_DOS || c == wxFILE_SEP_PATH_UNIX;