aboutsummaryrefslogtreecommitdiffstats
path: root/test/stdbin.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-20 07:17:20 +0200
committerMax Kellermann <max@duempel.org>2010-05-20 09:20:30 +0200
commit9aeed069641d69d69290a802f3626d2e6d804abc (patch)
treeb38a31d79f7ae3301eef70eec5dca26ad9010684 /test/stdbin.h
parenteda46bc07f8bb557c4d208045a1eca73bc9d5f92 (diff)
downloadmpd-9aeed069641d69d69290a802f3626d2e6d804abc.tar.gz
mpd-9aeed069641d69d69290a802f3626d2e6d804abc.tar.xz
mpd-9aeed069641d69d69290a802f3626d2e6d804abc.zip
test: enable binary mode on stdin/stdout
Declaring the global variable _CRT_fmode is a documented hack. What an ugly platform!
Diffstat (limited to 'test/stdbin.h')
-rw-r--r--test/stdbin.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/stdbin.h b/test/stdbin.h
new file mode 100644
index 000000000..362605ad9
--- /dev/null
+++ b/test/stdbin.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPD_STDBIN_H
+#define MPD_STDBIN_H
+
+#ifdef WIN32
+#include <fcntl.h>
+/** set binary mode on stdin/stdout */
+int _CRT_fmode = _O_BINARY;
+#endif
+
+#endif