2009-11-09 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Mon, 9 Nov 2009 12:27:34 +0000 (12:27 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:52 +0000 (21:06 +0400)
* os_dep.c (SIZE_T, PULONG_PTR): Remove.
* os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
"word"); add the comment.
* os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".

ChangeLog
os_dep.c

index 419c7ef..41accb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-11-09  Ivan Maidanski <ivmai@mail.ru>
+
+       * os_dep.c (SIZE_T, PULONG_PTR): Remove.
+       * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
+       "word"); add the comment.
+       * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
+       GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
+
 2009-11-07  Ivan Maidanski <ivmai@mail.ru>
 
        * win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two
index 13dda9e..a525283 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -1424,18 +1424,13 @@ void GC_register_data_segments(void)
 #     define WRITE_WATCH_FLAG_RESET 1
 #   endif
 
-#   if !defined(_BASETSD_H_) && !defined(_BASETSD_H)
-#     ifdef _WIN64
-        typedef unsigned __int64 ULONG_PTR;
-#     else
-        typedef unsigned long ULONG_PTR;
-#     endif
-      typedef ULONG_PTR SIZE_T;
-      typedef ULONG_PTR * PULONG_PTR;
-#   endif
+    /* Since we can't easily check whether ULONG_PTR and SIZE_T are     */
+    /* defined in Win32 basetsd.h, we define own ULONG_PTR.             */
+#   define GC_ULONG_PTR word
 
     typedef UINT (WINAPI * GetWriteWatch_type)(
-      DWORD, PVOID, SIZE_T, PVOID*, PULONG_PTR, PULONG);
+                                DWORD, PVOID, GC_ULONG_PTR /* SIZE_T */,
+                                PVOID *, GC_ULONG_PTR *, PULONG);
     static GetWriteWatch_type GetWriteWatch_func;
     static DWORD GetWriteWatch_alloc_flag;
 
@@ -1480,7 +1475,7 @@ void GC_register_data_segments(void)
                                     PAGE_READWRITE);
         if (page != NULL) {
           PVOID pages[16];
-          ULONG_PTR count = 16;
+          GC_ULONG_PTR count = 16;
           DWORD page_size;
           /* Check that it actually works.  In spite of some            */
           /* documentation it actually seems to exist on W2K.           */
@@ -2500,7 +2495,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
     BZERO(GC_grungy_pages, sizeof(GC_grungy_pages));
 
     for (i = 0; i != GC_n_heap_sects; ++i) {
-      ULONG_PTR count;
+      GC_ULONG_PTR count;
 
       do {
         PVOID * pages, * pages_end;