X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bddd7a8d8953cf4c09e56c13e1bfcc594ba0267e..4b5e5cfb2230d990c6988266340329c420cd1a74:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 4435d32614..eb714186e3 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -12,7 +12,7 @@ #ifndef _FILEFN_H_ #define _FILEFN_H_ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "filefn.h" #endif @@ -74,9 +74,11 @@ enum wxSeekMode // 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(__DMC__) && defined(__WXMSW__) ) \ + || ( defined(__WATCOMC__) && defined(__WXMSW__) ) // functions -#ifdef __BORLANDC__ +#if defined(__BORLANDC__) || defined(__WATCOMC__) #define _tell tell #endif #define wxClose _close @@ -111,15 +113,23 @@ enum wxSeekMode #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 @@ -128,7 +138,7 @@ enum wxSeekMode #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 @@ -154,6 +164,9 @@ enum wxSeekMode #if defined(__MWERKS__) && defined(macintosh) #include #endif +#if defined(__DMC__) + typedef unsigned long mode_t; +#endif 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 ); @@ -264,16 +277,6 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); // compatibility defines, don't use in new code #define wxDirExists wxPathExists -#if WXWIN_COMPATIBILITY_2 - #define FileExists wxFileExists - #define DirExists wxDirExists - #define IsAbsolutePath wxIsAbsolutePath - #define FileNameFromPath wxFileNameFromPath - #define PathOnly wxPathOnly - #define Dos2UnixFilename wxDos2UnixFilename - #define Unix2DosFilename wxUnix2DosFilename -#endif - // ---------------------------------------------------------------------------- // separators in file names // ---------------------------------------------------------------------------- @@ -299,7 +302,7 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); #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__) @@ -315,7 +318,7 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); // 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 @@ -325,7 +328,7 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); 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; @@ -360,12 +363,13 @@ WXDLLIMPEXP_BASE time_t wxFileModificationTime(const wxString& filename); class WXDLLIMPEXP_BASE wxPathList : public wxStringList { public: + // avoid GCC warning about virtual functions w/o virtual dtor + virtual ~wxPathList() {} + // Adds all paths in environment variable void AddEnvList(const wxString& envVariable); void Add(const wxString& path); - // Avoid compiler warning - wxNode *Add(const wxChar *s) { return wxStringList::Add(s); } // Find the first full path for which the file exists wxString FindValidPath(const wxString& filename); // Find the first full path for which the file exists; ensure it's an @@ -377,7 +381,7 @@ public: bool Member(const wxString& path); private: - DECLARE_DYNAMIC_CLASS(wxPathList) + // DECLARE_DYNAMIC_CLASS(wxPathList) }; #endif