-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImports.cpp
More file actions
81 lines (65 loc) · 2.15 KB
/
Copy pathImports.cpp
File metadata and controls
81 lines (65 loc) · 2.15 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <assert.h>
// CRT Internal assert
extern "C" _CRTIMP void __cdecl _assert(const char* _Message, const char* _File, unsigned _Line);
extern "C" {
// --- String Handling ---
char* __cdecl vc6_strrchr(const char* _Str, int _Val) {
return (char*)strrchr(_Str, _Val);
}
char* __cdecl vc6_strncpy(char* _Dest, const char* _Source, size_t _Count) {
return strncpy(_Dest, _Source, _Count);
}
char* __cdecl vc6_strcpy(char* _Dest, const char* _Source) {
return strcpy(_Dest, _Source);
}
// --- Memory Management ---
void* __cdecl vc6_memset(void* _Dst, int _Val, size_t _Size) {
return memset(_Dst, _Val, _Size);
}
void* __cdecl vc6_memcpy(void* _Dst, const void* _Src, size_t _Size) {
return memcpy(_Dst, _Src, _Size);
}
// --- I/O and Formatting ---
int __cdecl vc6_sprintf(char* _Dest, const char* _Format, ...) {
va_list args;
va_start(args, _Format);
int result = vsprintf(_Dest, _Format, args);
va_end(args);
return result;
}
int __cdecl vc6_fprintf(FILE* _Stream, const char* _Format, ...) {
va_list args;
va_start(args, _Format);
int result = vfprintf(_Stream, _Format, args);
va_end(args);
return result;
}
int __cdecl vc6_vsnprintf(char* _Dest, size_t _Count, const char* _Format, va_list _Args) {
return _vsnprintf(_Dest, _Count, _Format, _Args);
}
FILE* __cdecl vc6_fopen(const char* _FileName, const char* _Mode) {
return fopen(_FileName, _Mode);
}
int __cdecl vc6_fflush(FILE* _Stream) {
return fflush(_Stream);
}
int __cdecl vc6_fclose(FILE* _Stream) {
return fclose(_Stream);
}
void __cdecl vc6_assert(const char* _Message, const char* _File, unsigned _Line) {
_assert(_Message, _File, _Line);
}
void __cdecl vc6_exit(int _Code) {
exit(_Code);
}
void* __cdecl vc6_new(size_t Size) {
return operator new(Size);
}
void __cdecl vc6_delete(void* _Block) {
free(_Block);
}
}