1
0
forked from 0ad/0ad

sysdep: inline vsprintf2 definition (no need for printf.h)

win.cpp: remove hWnd (not needed for clipboard code) and TSC reference
(a temporary hack)

This was SVN commit r1840.
This commit is contained in:
janwas 2005-01-27 15:50:11 +00:00
parent 09985eaa7e
commit f55107c114
4 changed files with 12 additions and 18 deletions

View File

@ -1,3 +1,4 @@
//
// OS
//

View File

@ -12,8 +12,11 @@
#include "unix/unix.h"
#endif
// vsnprintf2: handles positional parameters and %lld.
// already available on *nix, emulated on Win32.
#ifdef _WIN32
#include "lib/sysdep/win/printf.h"
extern int vsnprintf2(char* buffer, size_t count, const char* format, va_list argptr);
#else
#define vsnprintf2 vsnprintf
#endif

View File

@ -28,7 +28,6 @@
#include <malloc.h>
#include <shlobj.h> // pick_dir
extern HWND hWnd;
void sle(int x)
{
@ -120,7 +119,10 @@ int clipboard_set(const wchar_t* text)
{
int err = -1;
if(!OpenClipboard( hWnd ))
const HWND new_owner = 0;
// MSDN: passing 0 requests the current task be granted ownership;
// there's no need to pass our window handle.
if(!OpenClipboard(new_owner))
return err;
EmptyClipboard();
@ -365,6 +367,7 @@ static inline void pre_main_init()
// (w)sdl will take care of it anyway.
}
#ifdef HAVE_DEBUGALLOC
// Enable heap corruption checking after every allocation. Has the same
// effect as PARANOIA in pre_main_init, but lets you switch it on anywhere
// so that you can skip checking the whole of the initialisation code.
@ -376,23 +379,10 @@ void memory_debug_extreme_turbo_plus()
{
_CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF );
}
extern u64 rdtsc();
extern u64 PREVTSC;
u64 PREVTSC;
#endif
int entry()
{
#ifdef _MSC_VER
u64 TSC=rdtsc();
debug_out(
"----------------------------------------\n"\
"ENTRY\n"\
"----------------------------------------\n");
PREVTSC=TSC;
#endif
pre_libc_init();
return WinMainCRTStartup(); // calls _cinit, and then WinMain
}

View File

@ -925,7 +925,7 @@ TIMER(InitRenderer)
g_Renderer.SetViewport(vp);
}
extern u64 PREVTSC;
u64 PREVTSC;
static void Shutdown()
{