TProcura
Biblioteca em C++ para testes paramétricos de algoritmos, e coleção de algoritmos de procura e otimização
Loading...
Searching...
No Matches
compact.h
Go to the documentation of this file.
1
// compat.h
2
#pragma once
3
#include <cstdio>
4
#include <cstring>
5
6
namespace
compat
{
7
8
inline
FILE*
fopen
(
const
char
* filename,
const
char
* mode) {
9
#ifdef _MSC_VER
10
FILE* f =
nullptr
;
11
fopen_s(&f, filename, mode);
12
return
f;
13
#else
14
return
std::fopen(filename, mode);
15
#endif
16
}
17
18
inline
char
*
strtok
(
char
* str,
const
char
* delim,
char
** context) {
19
#ifdef _MSC_VER
20
return
strtok_s(str, delim, context);
21
#else
22
return
strtok_r(str, delim, context);
23
#endif
24
}
25
26
}
// namespace compat
compat
Definition
compact.h:6
compat::fopen
FILE * fopen(const char *filename, const char *mode)
Definition
compact.h:8
compat::strtok
char * strtok(char *str, const char *delim, char **context)
Definition
compact.h:18
compact.h
Generated by
1.9.8