Use #elif defined() to check for config.h macros instead of plain #elif

This way, the code works with a config.h that does not define those macros.
objectmenu
Günther Brammer 2015-02-09 00:58:19 +01:00
parent 609b64f72b
commit a19e7f6ced
2 changed files with 3 additions and 3 deletions

View File

@ -511,7 +511,7 @@ bool C4UpdatePackage::DoUpdate(C4Group *pGrpFrom, C4GroupEx *pGrpTo, const char
{
#ifdef _WIN32
OutputDebugString(FormatString("updating %s\\%s\n", pGrpTo->GetFullName().getData(), strFileName).GetWideChar());
#elif _DEBUG
#elif defined(_DEBUG)
printf("updating %s\\%s\n", pGrpTo->GetFullName().getData(), strFileName);
#endif
if (!C4Group_CopyEntry(pGrpFrom, pGrpTo, strFileName))

View File

@ -54,7 +54,7 @@ bool OpenLog()
sLogFileName = C4CFN_Log; int iLog = 2;
#ifdef _WIN32
while (!(C4LogFile = _fsopen(Config.AtUserDataPath(sLogFileName.getData()), "wt", _SH_DENYWR)))
#elif HAVE_SYS_FILE_H
#elif defined(HAVE_SYS_FILE_H)
while (!(C4LogFile = fopen(Config.AtUserDataPath(sLogFileName.getData()), "wb")) || flock(fileno(C4LogFile),LOCK_EX|LOCK_NB))
#else
while (!(C4LogFile = fopen(Config.AtUserDataPath(sLogFileName.getData()), "wb")))
@ -81,7 +81,7 @@ bool OpenExtraLogs()
{
#ifdef _WIN32
C4ShaderLogFile = _fsopen(Config.AtUserDataPath(C4CFN_LogShader), "wt", _SH_DENYWR);
#elif HAVE_SYS_FILE_H
#elif defined(HAVE_SYS_FILE_H)
C4ShaderLogFile = fopen(Config.AtUserDataPath(C4CFN_LogShader), "wb");
if (C4ShaderLogFile && flock(fileno(C4ShaderLogFile), LOCK_EX | LOCK_NB) != 0)
{