HANDLE is a bad symbol for portable code!
authorjhurst <jhurst@cinecert.com>
Tue, 10 Mar 2009 19:07:45 +0000 (19:07 +0000)
committerjhurst <>
Tue, 10 Mar 2009 19:07:45 +0000 (19:07 +0000)
src/KM_fileio.cpp
src/KM_fileio.h

index 4f028f4c28a6f08772f9f547cc931e630dc92b40..c008957f595cc5d696c73f342c658da859da5328 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004-2007, John Hurst
+Copyright (c) 2004-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -113,7 +113,7 @@ do_stat(const char* path, fstat_t* stat_info)
 
 //
 static Kumu::Result_t
-do_fstat(HANDLE handle, fstat_t* stat_info)
+do_fstat(FileHandle handle, fstat_t* stat_info)
 {
   KM_TEST_NULL_L(stat_info);
 
@@ -676,7 +676,7 @@ Kumu::FileReader::Tell(Kumu::fpos_t* pos) const
 {
   KM_TEST_NULL_L(pos);
 
-  if ( m_Handle == (HANDLE)-1L )
+  if ( m_Handle == INVALID_HANDLE_VALUE )
     return Kumu::RESULT_FILEOPEN;
 
   LARGE_INTEGER in;
index ceeb8eb57e736d82d398f70eb915d61f1de1e8d2..fbe15c193bc0a976b4dcc10b91dcd07a16a57ead 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004-2007, John Hurst
+Copyright (c) 2004-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -82,8 +82,8 @@ namespace Kumu
 #else
   typedef off_t    fsize_t;
   typedef off_t    fpos_t;
-  typedef int      HANDLE;
-  const HANDLE INVALID_HANDLE_VALUE = -1L;
+  typedef int      FileHandle;
+  const FileHandle INVALID_HANDLE_VALUE = -1L;
 
   enum SeekPos_t {
     SP_BEGIN = SEEK_SET,
@@ -221,7 +221,7 @@ namespace Kumu
 
     protected:
       std::string m_Filename;
-      HANDLE      m_Handle;
+      FileHandle  m_Handle;
 
     public:
       FileReader() : m_Handle(INVALID_HANDLE_VALUE) {}