-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrmsdebug.h
More file actions
59 lines (45 loc) · 1020 Bytes
/
Copy pathrmsdebug.h
File metadata and controls
59 lines (45 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright Ryan Schmidt 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef __RMS_DEBUG_H__
#define __RMS_DEBUG_H__
#ifdef _WIN32
#include "windows.h"
#pragma warning(disable:4505)
#endif
#include <string>
using namespace std;
#include <stdio.h>
#include <stdarg.h>
#include <cstdio>
static int _RMSInfo(const char * str, ...)
{
static char buf[1024];
va_list args;
va_start(args, str);
//
#ifdef _WIN32
vsprintf_s(buf, 1024, str, args);
OutputDebugString(buf);
#else
vsprintf(buf, str, args);
fprintf(stderr, "%s", buf);
#endif
va_end(args);
return 0;
}
static string _RMSInfoString(char * str, ...)
{
static char buf[1024];
va_list args;
va_start(args, str);
//vsprintf_s(buf, 1024, str, args);
#ifdef _WIN32
vsprintf_s(buf, 1024, str, args);
#else
vsprintf(buf, str, args);
#endif
va_end(args);
return string(buf);
}
#endif // __RMS_DEBUG_H__