filesystem: fixed build for Windows
This commit is contained in:
parent
a8674c18df
commit
fd7dba74cd
5 changed files with 17 additions and 4 deletions
|
@ -219,8 +219,8 @@ public:
|
||||||
|
|
||||||
void FileTimeToString( char *p, int size, long int time ) override
|
void FileTimeToString( char *p, int size, long int time ) override
|
||||||
{
|
{
|
||||||
char *buf = ctime( &time );
|
time_t curtime = time;
|
||||||
|
char *buf = ctime( &curtime );
|
||||||
Q_strncpy( p, buf, size );
|
Q_strncpy( p, buf, size );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1313,7 +1313,7 @@ static qboolean FS_FindLibrary( const char *dllname, qboolean directpath, fs_dll
|
||||||
#if XASH_WIN32 && XASH_X86 // a1ba: custom loader is non-portable (I just don't want to touch it)
|
#if XASH_WIN32 && XASH_X86 // a1ba: custom loader is non-portable (I just don't want to touch it)
|
||||||
Con_Printf( S_WARN "%s: loading libraries from packs is deprecated "
|
Con_Printf( S_WARN "%s: loading libraries from packs is deprecated "
|
||||||
"and will be removed in the future\n", __FUNCTION__ );
|
"and will be removed in the future\n", __FUNCTION__ );
|
||||||
*custom_loader = true;
|
dllInfo->custom_loader = true;
|
||||||
#else
|
#else
|
||||||
Con_Printf( S_WARN "%s: loading libraries from packs is unsupported on "
|
Con_Printf( S_WARN "%s: loading libraries from packs is unsupported on "
|
||||||
"this platform\n", __FUNCTION__ );
|
"this platform\n", __FUNCTION__ );
|
||||||
|
@ -1390,8 +1390,9 @@ qboolean FS_InitStdio( qboolean caseinsensitive, const char *rootdir, const char
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
FS_InitMemory();
|
FS_InitMemory();
|
||||||
|
#if !XASH_WIN32
|
||||||
fs_caseinsensitive = caseinsensitive;
|
fs_caseinsensitive = caseinsensitive;
|
||||||
|
#endif
|
||||||
|
|
||||||
Q_strncpy( fs_rootdir, rootdir, sizeof( fs_rootdir ));
|
Q_strncpy( fs_rootdir, rootdir, sizeof( fs_rootdir ));
|
||||||
Q_strncpy( fs_gamedir, gamedir, sizeof( fs_gamedir ));
|
Q_strncpy( fs_gamedir, gamedir, sizeof( fs_gamedir ));
|
||||||
|
@ -1979,8 +1980,13 @@ int FS_Flush( file_t *file )
|
||||||
FS_Purge( file );
|
FS_Purge( file );
|
||||||
|
|
||||||
// sync
|
// sync
|
||||||
|
#if XASH_POSIX
|
||||||
if( fsync( file->handle ) < 0 )
|
if( fsync( file->handle ) < 0 )
|
||||||
return EOF;
|
return EOF;
|
||||||
|
#else
|
||||||
|
if( fflush( file->handle ) < 0 )
|
||||||
|
return EOF;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "build.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#if XASH_POSIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
|
|
|
@ -17,7 +17,9 @@ GNU General Public License for more details.
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#if XASH_POSIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
|
|
|
@ -17,7 +17,9 @@ GNU General Public License for more details.
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#if XASH_POSIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include STDINT_H
|
#include STDINT_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue