KiCad PCB EDA Suite
platform.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2017 Peter Selinger.
2  * This file is part of Potrace. It is free software and it is covered
3  * by the GNU General Public License. See the file COPYING for details. */
4 
5 /* this header file contains some platform dependent stuff */
6 
7 #ifndef PLATFORM_H
8 #define PLATFORM_H
9 
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13 
14 /* in Windows, set all file i/o to binary */
15 #ifdef __MINGW32__
16 #include <fcntl.h>
17 unsigned int _CRT_fmode = _O_BINARY;
18 static inline void platform_init( void )
19 {
20  _setmode( _fileno( stdin ), _O_BINARY );
21  _setmode( _fileno( stdout ), _O_BINARY );
22 }
23 
24 
25 #else
26 
27 #ifdef __CYGWIN__
28 #include <fcntl.h>
29 #include <io.h>
30 static inline void platform_init( void )
31 {
32  setmode( 0, O_BINARY );
33  setmode( 1, O_BINARY );
34 }
35 
36 
37 #else
38 static inline void platform_init( void )
39 {
40  /* NOP */
41 }
42 
43 
44 #endif
45 #endif
46 
47 #endif /* PLATFORM_H */
static void platform_init(void)
Definition: platform.h:38