summaryrefslogtreecommitdiff
path: root/Build/source/libs/potrace/potrace-1.11/src/platform.h
blob: 25e4aefb31dede2738f026c95c7f4e77418b7019 (plain)
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
/* Copyright (C) 2001-2013 Peter Selinger.
   This file is part of Potrace. It is free software and it is covered
   by the GNU General Public License. See the file COPYING for details. */

/* this header file contains some platform dependent stuff */

#ifndef PLATFORM_H
#define PLATFORM_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

/* in Windows, set all file i/o to binary */
#ifdef __MINGW32__
#include <fcntl.h>
unsigned int _CRT_fmode = _O_BINARY;
#endif

#ifdef __CYGWIN__
#include <fcntl.h>
#include <io.h>
static inline void platform_init(void) {
  setmode(0,O_BINARY); 
  setmode(1,O_BINARY);
}
#else
static inline void platform_init(void) {
  /* NOP */
}
#endif

#endif /* PLATFORM_H */