aboutsummaryrefslogtreecommitdiffstats
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
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!
-rw-r--r--test/run_convert.c1
-rw-r--r--test/run_decoder.c1
-rw-r--r--test/run_encoder.c1
-rw-r--r--test/run_filter.c1
-rw-r--r--test/run_input.c1
-rw-r--r--test/run_normalize.c1
-rw-r--r--test/run_output.c1
-rw-r--r--test/software_volume.c1
-rw-r--r--test/stdbin.h29
9 files changed, 37 insertions, 0 deletions
diff --git a/test/run_convert.c b/test/run_convert.c
index ddfca0870..415d7535c 100644
--- a/test/run_convert.c
+++ b/test/run_convert.c
@@ -29,6 +29,7 @@
#include "pcm_convert.h"
#include "conf.h"
#include "fifo_buffer.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/run_decoder.c b/test/run_decoder.c
index ef268773a..92112cef6 100644
--- a/test/run_decoder.c
+++ b/test/run_decoder.c
@@ -25,6 +25,7 @@
#include "audio_format.h"
#include "pcm_volume.h"
#include "idle.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/run_encoder.c b/test/run_encoder.c
index b8820572a..4b512d46a 100644
--- a/test/run_encoder.c
+++ b/test/run_encoder.c
@@ -23,6 +23,7 @@
#include "audio_format.h"
#include "audio_parser.h"
#include "conf.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/run_filter.c b/test/run_filter.c
index 29fa502e1..ee2445eac 100644
--- a/test/run_filter.c
+++ b/test/run_filter.c
@@ -26,6 +26,7 @@
#include "idle.h"
#include "mixer_control.h"
#include "playlist.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/run_input.c b/test/run_input.c
index 9a31019dd..a50cd70ab 100644
--- a/test/run_input.c
+++ b/test/run_input.c
@@ -23,6 +23,7 @@
#include "tag_pool.h"
#include "tag_save.h"
#include "conf.h"
+#include "stdbin.h"
#ifdef ENABLE_ARCHIVE
#include "archive_list.h"
diff --git a/test/run_normalize.c b/test/run_normalize.c
index 8b93ea256..dd1140782 100644
--- a/test/run_normalize.c
+++ b/test/run_normalize.c
@@ -27,6 +27,7 @@
#include "AudioCompress/compress.h"
#include "audio_parser.h"
#include "audio_format.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/run_output.c b/test/run_output.c
index 188f87104..5028068ff 100644
--- a/test/run_output.c
+++ b/test/run_output.c
@@ -28,6 +28,7 @@
#include "event_pipe.h"
#include "idle.h"
#include "playlist.h"
+#include "stdbin.h"
#include <glib.h>
diff --git a/test/software_volume.c b/test/software_volume.c
index 55f2b0b54..c4de69328 100644
--- a/test/software_volume.c
+++ b/test/software_volume.c
@@ -27,6 +27,7 @@
#include "pcm_volume.h"
#include "audio_parser.h"
#include "audio_format.h"
+#include "stdbin.h"
#include <glib.h>
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