r4018: Auto commit for Debian build
[wdq2wav.git] / wdq2wav.cpp
index ff0430a21fdfa5e82f2d9794c7303210b9196104..392a108d71835413badb9c84afa4f56a66cd6133 100644 (file)
@@ -8,7 +8,7 @@
 **
 **  Copyright (c) 2003 Kevin Rosenberg
 **
-**  $Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $
+**  $Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
 
 #include <wdq2wav.h>
 
-const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $";
+const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $";
 
 bool g_quiet = false;
 bool g_verbose = false;
 bool g_debug = false;
 
+// Define as NULL for non-Windows platforms
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+
 void
 error_msg (const char *msg)
 {
@@ -306,7 +312,7 @@ WindaqFile::ReadHeader ()
   unsigned short int tmp2;
 
   m_valid = false;
-  if ((m_fd = open (m_strFile.c_str(), O_RDONLY)) < 0) {
+  if ((m_fd = open (m_strFile.c_str(), O_RDONLY | O_BINARY)) < 0) {
     m_error = "Unable to open file";
     return false;
   }
@@ -607,7 +613,7 @@ WavFile::WriteFile ()
     return false;
 
   if (m_fd == 0)
-    if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 
+    if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_BINARY | O_TRUNC | O_CREAT, 
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == 0) {
       std::ostringstream os;
       os << "Error opening output file " << m_strFile.c_str();