GUIDOLib  1.7.7
Guido Engine Internal Documentation
secureio.h
1 #ifndef __secureio__
2 #define __secureio__
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2008 Grame
7 
8  This Source Code Form is subject to the terms of the Mozilla Public
9  License, v. 2.0. If a copy of the MPL was not distributed with this
10  file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
13  research@grame.fr
14 
15 */
16 
17 #ifdef WIN32
18 
19 # include <stdio.h>
20 
21 #ifdef MSVC
22 # define sscanf sscanf_s
23 # define snprintf _snprintf_s
24 # define snprsize(n) (n),_TRUNCATE
25 # define strncpy(dst,src,n) strncpy_s(dst,n,src,_TRUNCATE )
26 # define strncat(dst,src,n) strncat_s(dst,n,src,_TRUNCATE)
27 # define fopen(file,mode) fopens(file,mode)
28 
29 inline FILE * fopens (const char * file, const char* mode)
30 { FILE* fd; errno_t err = fopen_s(&fd, file,mode); if(err) fd=0; return fd; }
31 
32 #elif defined (VC6)
33 # define snprintf _snprintf
34 # define snprsize(n) (n)
35 #endif
36 
37 #else
38 
39 # include <cstdio>
40 # define snprsize(n) (n)
41 
42 #endif
43 
44 #endif

Guido Project Copyright © 2019 Grame-CNCM