mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
these are required by thesis and improve 0ad code.
- sysdep/win init/shutdown mechanism is now better documented and
survives clever vc8 optimization
- moved some extern declarations from win_internal into separate headers
main: remove debug_filter_add("LOADER") - was for my debugging
convenience
This was SVN commit r4752.
27 lines
485 B
C++
27 lines
485 B
C++
#include "precompiled.h"
|
|
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
|
|
#include "secure_crt.h"
|
|
|
|
|
|
int sprintf_s(char* buf, size_t max_chars, const char* fmt, ...)
|
|
{
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
int len = vsnprintf(buf, max_chars, fmt, args);
|
|
va_end(args);
|
|
return len;
|
|
}
|
|
|
|
|
|
errno_t fopen_s(FILE** pfile, const char* filename, const char* mode)
|
|
{
|
|
*pfile = NULL;
|
|
FILE* file = fopen(filename, mode);
|
|
if(!file)
|
|
return ENOENT;
|
|
*pfile = file;
|
|
return 0;
|
|
}
|