[MOAB-dev] r1450 - in MOAB/trunk: . mhdf/src tools/dagmc

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Dec 7 15:23:09 CST 2007


Author: kraftche
Date: 2007-12-07 15:23:09 -0600 (Fri, 07 Dec 2007)
New Revision: 1450

Modified:
   MOAB/trunk/WriteHDF5.cpp
   MOAB/trunk/mhdf/src/file-handle.h
   MOAB/trunk/tools/dagmc/cubfile.c
Log:
Windows portability fixes from Byron

Modified: MOAB/trunk/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/WriteHDF5.cpp	2007-12-07 21:17:55 UTC (rev 1449)
+++ MOAB/trunk/WriteHDF5.cpp	2007-12-07 21:23:09 UTC (rev 1450)
@@ -31,10 +31,13 @@
 #endif
 
 #include <assert.h>
+#ifndef _MSC_VER
 #include <sys/time.h>
+#endif
 #include <time.h>
 #include <stdlib.h>
 #include <string.h>
+#include <limits>
 #include <H5Tpublic.h>
 #include "MBInterface.hpp"
 #include "MBInternals.hpp"
@@ -174,19 +177,19 @@
   
   // if same saize
   MBEntityHandle *buffer, *end;
-  id_t* witer;
+  WriteHDF5::id_t* witer;
   int step;
-  if (sizeof(MBEntityHandle) >= sizeof(id_t)) {
+  if (sizeof(MBEntityHandle) >= sizeof(WriteHDF5::id_t)) {
     buffer = (MBEntityHandle*)data;
     end = buffer + count;
-    witer = (id_t*)data;
+    witer = (WriteHDF5::id_t*)data;
     step = 1;
   }
   else {
     // iterate in reverse order if sizeof(id_t) > sizeof(MBEntityHandle)
     buffer = (MBEntityHandle*)data + count - 1;
     end = (MBEntityHandle*)data - 1;
-    witer = (id_t*)data + count - 1;
+    witer = (WriteHDF5::id_t*)data + count - 1;
     step = -1;
   }
   for ( ; buffer != end; buffer += step, witer += step) {

Modified: MOAB/trunk/mhdf/src/file-handle.h
===================================================================
--- MOAB/trunk/mhdf/src/file-handle.h	2007-12-07 21:17:55 UTC (rev 1449)
+++ MOAB/trunk/mhdf/src/file-handle.h	2007-12-07 21:23:09 UTC (rev 1450)
@@ -16,6 +16,10 @@
 #ifndef MHDF_FILE_HANDLE_H
 #define MHDF_FILE_HANDLE_H
 
+#ifdef _MSC_VER /* windows */
+#  include <BaseTsd.h>
+typedef ULONG32 uint32_t;
+#endif
 #include "mhdf.h"
 
 #ifdef __cplusplus

Modified: MOAB/trunk/tools/dagmc/cubfile.c
===================================================================
--- MOAB/trunk/tools/dagmc/cubfile.c	2007-12-07 21:17:55 UTC (rev 1449)
+++ MOAB/trunk/tools/dagmc/cubfile.c	2007-12-07 21:23:09 UTC (rev 1450)
@@ -12,7 +12,16 @@
  */
 
 #include <stdlib.h>
+
+#ifdef MOAB_HAVE_STDINT_H
 #include <stdint.h>
+#endif
+
+#ifdef _MSC_VER /* windows */
+#  include <BaseTsd.h>
+typedef ULONG32 uint32_t;
+#endif
+
 #include <errno.h>
 #include <string.h>
 #include "cubfile.h"




More information about the moab-dev mailing list