summaryrefslogtreecommitdiff
path: root/potrace/platform.h
diff options
context:
space:
mode:
authorsaurabhb172020-02-26 16:40:14 +0530
committerGitHub2020-02-26 16:40:14 +0530
commit02c614b4e64b68758f223391cb5357b3eec78cac (patch)
treead18839d8b4eb1f13419d07878cc4ec4c9b70032 /potrace/platform.h
parentb77f5d9d8097c38159c6f60917995d6af13bbe1c (diff)
parent07a8c86216b6b1f694b136ec64c281d62941952e (diff)
downloadKiCad-eSim-02c614b4e64b68758f223391cb5357b3eec78cac.tar.gz
KiCad-eSim-02c614b4e64b68758f223391cb5357b3eec78cac.tar.bz2
KiCad-eSim-02c614b4e64b68758f223391cb5357b3eec78cac.zip
Merge pull request #6 from saurabhb17/master
minor additions
Diffstat (limited to 'potrace/platform.h')
-rw-r--r--potrace/platform.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/potrace/platform.h b/potrace/platform.h
new file mode 100644
index 0000000..1f8dd53
--- /dev/null
+++ b/potrace/platform.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2001-2007 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 */