Skip to content

Commit

Permalink
Common: added defines utime for Linux build
Browse files Browse the repository at this point in the history
xrCore: hidden under define functions of file dialogs
  • Loading branch information
eagleivg committed May 24, 2018
1 parent 51f9706 commit d7447ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ inline int _filelength(int fd)
#undef max
#define __max(a, b) std::max(a, b)
#define __min(a, b) std::min(a, b)
#define _utime utime
#define _utimbuf utimbuf

#define xr_itoa SDL_itoa

Expand Down
10 changes: 9 additions & 1 deletion src/xrCore/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ bool EFS_Utils::GetOpenNameInternal(
LPCSTR initial, LPSTR buffer, int sz_buf, bool bMulti, LPCSTR offset, int start_flt_ext)
{
VERIFY(buffer && (sz_buf > 0));
#if defined(WINDOWS)
FS_Path& P = *FS.get_path(initial);
string1024 flt;
MakeFilter(flt, P.m_FilterCaption ? P.m_FilterCaption : "", P.m_DefExt);
Expand Down Expand Up @@ -179,6 +180,7 @@ bool EFS_Utils::GetOpenNameInternal(
case FNERR_BUFFERTOOSMALL: Log("Too many files selected."); break;
}
}

if (bRes && bMulti)
{
Log("buff=", buffer);
Expand Down Expand Up @@ -206,13 +208,16 @@ bool EFS_Utils::GetOpenNameInternal(
}
xr_strlwr(buffer);
return bRes;
#else
return true;
#endif
}

bool EFS_Utils::GetSaveName(LPCSTR initial, string_path& buffer, LPCSTR offset, int start_flt_ext)
{
// unsigned int dwVersion = GetVersion();
// unsigned int dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));

#if defined(WINDOWS)
FS_Path& P = *FS.get_path(initial);
string1024 flt;

Expand Down Expand Up @@ -269,6 +274,9 @@ bool EFS_Utils::GetSaveName(LPCSTR initial, string_path& buffer, LPCSTR offset,
}
xr_strlwr(buffer);
return bRes;
#else
return true;
#endif
}
//----------------------------------------------------
LPCSTR EFS_Utils::AppendFolderToName(LPSTR tex_name, u32 const tex_name_size, int depth, BOOL full_name)
Expand Down

0 comments on commit d7447ef

Please sign in to comment.