Consistency in Windows ifdefs/windows.h includes

Changing all defined(_WINDOWS) to defined(_WIN32)

Defining WIN32_LEAN_AND_MEAN in all files except those in Archutils/Win32
This commit is contained in:
sukibaby
2024-06-22 05:00:13 -07:00
committed by teejusb
parent 65fe06bcd3
commit 0447d9ae58
34 changed files with 84 additions and 69 deletions
+12 -13
View File
@@ -8,15 +8,14 @@
#include <sys/types.h>
#include <sys/stat.h>
#if !defined(WIN32)
#if defined(HAVE_DIRENT_H)
#include <dirent.h>
#endif
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <io.h>
#else
#include <windows.h>
#include <io.h>
#if defined(HAVE_DIRENT_H)
#include <dirent.h>
#endif
#endif
RString DoPathReplace(const RString &sPath)
@@ -26,7 +25,7 @@ RString DoPathReplace(const RString &sPath)
}
#if defined(WIN32)
#if defined(_WIN32)
static bool WinMoveFileInternal( const RString &sOldPath, const RString &sNewPath )
{
static bool Win9x = false;
@@ -94,7 +93,7 @@ bool CreateDirectories( RString Path )
curpath += "/";
curpath += parts[i];
#if defined(WIN32)
#if defined(_WIN32)
if( curpath.size() == 2 && curpath[1] == ':' ) /* C: */
{
/* Don't try to create the drive letter alone. */
@@ -105,7 +104,7 @@ bool CreateDirectories( RString Path )
if( DoMkdir(curpath, 0777) == 0 )
continue;
#if defined(WIN32)
#if defined(_WIN32)
/* When creating a directory that already exists over Samba, Windows is
* returning ENOENT instead of EEXIST. */
/* I can't reproduce this anymore. If we get ENOENT, log it but keep
@@ -170,7 +169,7 @@ void DirectFilenameDB::CacheFile( const RString &sPath )
while( !pFileSet->m_bFilled )
m_Mutex.Wait();
#if defined(WIN32)
#if defined(_WIN32)
// There is almost surely a better way to do this
WIN32_FIND_DATA fd;
HANDLE hFind = DoFindFirstFile( root+sPath, &fd );
@@ -220,7 +219,7 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path )
fs.age.GetDeltaTime(); // reset
fs.files.clear();
#if defined(WIN32)
#if defined(_WIN32)
WIN32_FIND_DATA fd;
if ( sPath.size() > 0 && sPath.Right(1) == "/" )