]> git.lizzy.rs Git - irrlicht.git/commitdiff
Drop _IRR_WCHAR_FILESYSTEM
authorsfan5 <sfan5@live.de>
Mon, 30 Aug 2021 18:44:51 +0000 (20:44 +0200)
committersfan5 <sfan5@live.de>
Mon, 30 Aug 2021 18:55:06 +0000 (20:55 +0200)
never used and never worked for us.

include/IrrCompileConfig.h
include/irrTypes.h
include/irrUString.h
source/Irrlicht/CFileSystem.cpp
source/Irrlicht/CGUIFileOpenDialog.cpp
source/Irrlicht/CReadFile.cpp
source/Irrlicht/CWriteFile.cpp

index 6dc28615b3179ad9dc26bcd8338c9488df7405ac..1b98e35c245275d0da35fb08933c69a9af082cb1 100644 (file)
@@ -332,16 +332,6 @@ you will not be able to use anything provided by the GUI Environment, including
 #undef _IRR_COMPILE_WITH_GUI_\r
 #endif\r
 \r
-//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.\r
-/** This enables the engine to read/write from unicode filesystem. If you\r
-disable this feature, the engine behave as before (ansi). This is currently only supported\r
-for Windows based systems. You also have to set #define UNICODE for this to compile.\r
-*/\r
-//#define _IRR_WCHAR_FILESYSTEM\r
-#ifdef NO_IRR_WCHAR_FILESYSTEM\r
-#undef _IRR_WCHAR_FILESYSTEM\r
-#endif\r
-\r
 //! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.\r
 /** This enables the engine to read jpeg images. If you comment this out,\r
 the engine will no longer read .jpeg images. */\r
@@ -529,10 +519,6 @@ ones. */
 \r
 #endif // _IRR_WINDOWS_API_\r
 \r
-#ifndef _IRR_WINDOWS_API_\r
-       #undef _IRR_WCHAR_FILESYSTEM\r
-#endif\r
-\r
 #if defined(_IRR_SOLARIS_PLATFORM_)\r
        #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_\r
 #endif\r
index 184870d537ea00f15bbc9ee13d5d24b308adbcad..e3561cfb2f7279d1cd3de8abfcc1f2686e9897ea 100644 (file)
@@ -73,22 +73,6 @@ typedef double                               f64;
 #define swprintf_irr _snwprintf\r
 #define snprintf_irr _snprintf\r
 #endif\r
-\r
-// define the wchar_t type if not already built in.\r
-#ifdef _MSC_VER\r
-#ifndef _WCHAR_T_DEFINED\r
-//! A 16 bit wide character type.\r
-/**\r
-       Defines the wchar_t-type.\r
-       In VS6, its not possible to tell\r
-       the standard compiler to treat wchar_t as a built-in type, and\r
-       sometimes we just don't want to include the huge stdlib.h or wchar.h,\r
-       so we'll use this.\r
-*/\r
-typedef unsigned short wchar_t;\r
-#define _WCHAR_T_DEFINED\r
-#endif // wchar is not defined\r
-#endif // microsoft compiler\r
 #else\r
 #define swprintf_irr swprintf\r
 #define snprintf_irr snprintf\r
@@ -98,18 +82,8 @@ namespace irr
 {\r
 \r
 //! Type name for character type used by the file system.\r
-/** Should the wide character version of the FileSystem be used it is a\r
-16 bit character variable. Used for Unicode Filesystem and Unicode strings.\r
-Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode\r
-strings\r
-*/\r
-#if defined(_IRR_WCHAR_FILESYSTEM)\r
-       typedef wchar_t fschar_t;\r
-       #define _IRR_TEXT(X) L##X\r
-#else\r
        typedef char fschar_t;\r
        #define _IRR_TEXT(X) X\r
-#endif\r
 \r
 } // end namespace irr\r
 \r
index c1c7925e57d15823e859df4121139eb7339dd4f2..49cc67044baaa228d46d0b545b426b999a055fc5 100644 (file)
@@ -3015,11 +3015,7 @@ public:
        //! \return An io::path string containing the properly encoded string.
        io::path toPATH_s(const unicode::EUTF_ENDIAN endian = unicode::EUTFEE_NATIVE, const bool addBOM = false) const
        {
-#if defined(_IRR_WCHAR_FILESYSTEM)
-               return toWCHAR_s(endian, addBOM);
-#else
                return toUTF8_s(addBOM);
-#endif
        }
 
        //! Loads an unknown stream of data.
index 7ba441f6001cf4774dadfef7738faf3f80405f63..5a9e1f4db667b3286b2fa0d861ac4f9531ab0fd4 100644 (file)
@@ -515,15 +515,9 @@ const io::path& CFileSystem::getWorkingDirectory()
        {\r
                #if defined(_IRR_WINDOWS_API_)\r
                        fschar_t tmp[_MAX_PATH];\r
-                       #if defined(_IRR_WCHAR_FILESYSTEM )\r
-                               _wgetcwd(tmp, _MAX_PATH);\r
-                               WorkingDirectory[FILESYSTEM_NATIVE] = tmp;\r
-                               WorkingDirectory[FILESYSTEM_NATIVE].replace(L'\\', L'/');\r
-                       #else\r
                                _getcwd(tmp, _MAX_PATH);\r
                                WorkingDirectory[FILESYSTEM_NATIVE] = tmp;\r
                                WorkingDirectory[FILESYSTEM_NATIVE].replace('\\', '/');\r
-                       #endif\r
                #endif\r
 \r
                #if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))\r
@@ -532,21 +526,6 @@ const io::path& CFileSystem::getWorkingDirectory()
                        // so try it until the call was successful\r
                        // Note that neither the first nor the second parameter may be 0 according to POSIX\r
 \r
-                       #if defined(_IRR_WCHAR_FILESYSTEM )\r
-                               u32 pathSize=256;\r
-                               wchar_t *tmpPath = new wchar_t[pathSize];\r
-                               while ((pathSize < (1<<16)) && !(wgetcwd(tmpPath,pathSize)))\r
-                               {\r
-                                       delete [] tmpPath;\r
-                                       pathSize *= 2;\r
-                                       tmpPath = new char[pathSize];\r
-                               }\r
-                               if (tmpPath)\r
-                               {\r
-                                       WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;\r
-                                       delete [] tmpPath;\r
-                               }\r
-                       #else\r
                                u32 pathSize=256;\r
                                char *tmpPath = new char[pathSize];\r
                                while ((pathSize < (1<<16)) && !(getcwd(tmpPath,pathSize)))\r
@@ -560,7 +539,6 @@ const io::path& CFileSystem::getWorkingDirectory()
                                        WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;\r
                                        delete [] tmpPath;\r
                                }\r
-                       #endif\r
                #endif\r
 \r
                WorkingDirectory[type].validate();\r
@@ -587,17 +565,9 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
                WorkingDirectory[FILESYSTEM_NATIVE] = newDirectory;\r
 \r
 #if defined(_MSC_VER)\r
-       #if defined(_IRR_WCHAR_FILESYSTEM)\r
-               success = (_wchdir(newDirectory.c_str()) == 0);\r
-       #else\r
                success = (_chdir(newDirectory.c_str()) == 0);\r
-       #endif\r
 #else\r
-       #if defined(_IRR_WCHAR_FILESYSTEM)\r
-               success = (_wchdir(newDirectory.c_str()) == 0);\r
-       #else\r
                success = (chdir(newDirectory.c_str()) == 0);\r
-       #endif\r
 #endif\r
        }\r
 \r
@@ -612,15 +582,9 @@ io::path CFileSystem::getAbsolutePath(const io::path& filename) const
 #if defined(_IRR_WINDOWS_API_)\r
        fschar_t *p=0;\r
        fschar_t fpath[_MAX_PATH];\r
-       #if defined(_IRR_WCHAR_FILESYSTEM )\r
-               p = _wfullpath(fpath, filename.c_str(), _MAX_PATH);\r
-               core::stringw tmp(p);\r
-               tmp.replace(L'\\', L'/');\r
-       #else\r
                p = _fullpath(fpath, filename.c_str(), _MAX_PATH);\r
                core::stringc tmp(p);\r
                tmp.replace('\\', '/');\r
-       #endif\r
        return tmp;\r
 #elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))\r
        c8* p=0;\r
@@ -958,17 +922,9 @@ bool CFileSystem::existFile(const io::path& filename) const
                        return true;\r
 \r
 #if defined(_MSC_VER)\r
-       #if defined(_IRR_WCHAR_FILESYSTEM)\r
-               return (_waccess(filename.c_str(), 0) != -1);\r
-       #else\r
                return (_access(filename.c_str(), 0) != -1);\r
-       #endif\r
 #elif defined(F_OK)\r
-       #if defined(_IRR_WCHAR_FILESYSTEM)\r
-               return (_waccess(filename.c_str(), F_OK) != -1);\r
-       #else\r
                return (access(filename.c_str(), F_OK) != -1);\r
-       #endif\r
 #else\r
        return (access(filename.c_str(), 0) != -1);\r
 #endif\r
index 25da8976c209ed4929325cef96321193722065dd..52b6808d98cfa2cd40220f7e25f34b8b09d80302 100644 (file)
@@ -5,8 +5,6 @@
 #include "CGUIFileOpenDialog.h"\r
 #ifdef _IRR_COMPILE_WITH_GUI_\r
 \r
-#include <locale.h>\r
-\r
 #include "IGUISkin.h"\r
 #include "IGUIEnvironment.h"\r
 #include "IVideoDriver.h"\r
@@ -382,14 +380,7 @@ void CGUIFileOpenDialog::deserializeAttributes(io::IAttributes* in, io::SAttribu
 \r
 void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p)\r
 {\r
-#ifndef _IRR_WCHAR_FILESYSTEM\r
-       char* oldLocale = setlocale(LC_CTYPE, NULL);\r
-       setlocale(LC_CTYPE,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale.\r
        core::multibyteToWString(result, p);\r
-       setlocale(LC_CTYPE, oldLocale);\r
-#else\r
-       result = p.c_str();\r
-#endif\r
 }\r
 \r
 //! fills the listbox with files.\r
index cf90f54b03c3fb2f0768c6b9acc8312a7bd76c90..3205d1c1d8b42d821efd61eaed56a1d9f634848a 100644 (file)
@@ -73,11 +73,7 @@ void CReadFile::openFile()
                return;\r
        }\r
 \r
-#if defined ( _IRR_WCHAR_FILESYSTEM )\r
-       File = _wfopen(Filename.c_str(), L"rb");\r
-#else\r
        File = fopen(Filename.c_str(), "rb");\r
-#endif\r
 \r
        if (File)\r
        {\r
index ef816b6b5ec11b0ba3885c18c9e5eb87ad292fc1..3279402a581ac54b1271181bb45beb90b8161904 100644 (file)
@@ -81,11 +81,7 @@ void CWriteFile::openFile(bool append)
                return;\r
        }\r
 \r
-#if defined(_IRR_WCHAR_FILESYSTEM)\r
-       File = _wfopen(Filename.c_str(), append ? L"ab" : L"wb");\r
-#else\r
        File = fopen(Filename.c_str(), append ? "ab" : "wb");\r
-#endif\r
 \r
        if (File)\r
        {\r