updates from orpheus for windoze build
[feisty_meow.git] / nucleus / library / filesystem / huge_file.cpp
index 21158ca45bb03cbee8aef01ccef60fd2df34cc86..5d8e7dc0db9393ba887ff9c9d7b1d37a7d8bd9b5 100644 (file)
 #include <basis/byte_array.h>
 #include <basis/functions.h>
 #include <basis/guards.h>
+#include <application/windoze_helper.h>
 
 #include <stdio.h>
-#ifndef __WIN32__
-  #include <sys/time.h>
-#else
-  #include <time.h>
-#endif
+//#ifndef __WIN32__
+#include <sys/time.h>
+//#else
+//  #include <time.h>
+//#endif
 
 #undef LOG
 #define LOG(to_print) printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s())
@@ -289,14 +290,14 @@ basis::outcome huge_file::touch()
   if (filename(_real_file->name()).exists()) {
     // file exists, so just update time.
 #ifndef __WIN32__
-    int ret = utimes(_real_file->name().observe(), NIL);
+    int ret = utimes(_real_file->name().observe(), NULL_POINTER);
     if (ret != 0)
       return FAILURE;
 #else
     // open the file, although the function says create in its name...
     HANDLE f = CreateFile(_real_file->name().observe(),
         GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
-        NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NIL);
+        NULL_POINTER, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL_POINTER);
     if (!f) {
       LOG(a_sprintf("failed to open file %s", _real_file->name().observe()));
       return FAILURE;
@@ -308,7 +309,7 @@ basis::outcome huge_file::touch()
     FILETIME *t = new FILETIME;
     SystemTimeToFileTime(st, t);
     // set the file's time.
-    SetFileTime(f, NIL, t, t);
+    SetFileTime(f, NULL_POINTER, t, t);
 #endif
   } else {
     // file doesn't exist yet.