2009-08-14 Ozkan Sezer <sezeroz@gmail.com>
* stddef.h, stdio.h, stdlib.h, string.h, tchar.h, time.h, wchar.h,
crtdbg.h, lmcons.h, locale.h, windef.h: Fix the __cplusplus NULL
macro, 0LL for _WIN64 instead of 0, so that sizeof(NULL) would be
the same as sizeof(void*).
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@1151 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/include/ChangeLog b/mingw-w64-headers/include/ChangeLog
index 77ef20a..96084ac 100644
--- a/mingw-w64-headers/include/ChangeLog
+++ b/mingw-w64-headers/include/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-14 Ozkan Sezer <sezeroz@gmail.com>
+
+ * stddef.h, stdio.h, stdlib.h, string.h, tchar.h, time.h, wchar.h,
+ crtdbg.h, lmcons.h, locale.h, windef.h: Fix the __cplusplus NULL
+ macro, 0LL for _WIN64 instead of 0, so that sizeof(NULL) would be
+ the same as sizeof(void*).
+
2009-08-14 Kai Tietz <kai.tietz@onevision.com>
PR/2836856
diff --git a/mingw-w64-headers/include/crtdbg.h b/mingw-w64-headers/include/crtdbg.h
index 797998a..53b01cc 100644
--- a/mingw-w64-headers/include/crtdbg.h
+++ b/mingw-w64-headers/include/crtdbg.h
@@ -12,8 +12,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/lmcons.h b/mingw-w64-headers/include/lmcons.h
index caef12d..7a12ed3 100644
--- a/mingw-w64-headers/include/lmcons.h
+++ b/mingw-w64-headers/include/lmcons.h
@@ -100,8 +100,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/locale.h b/mingw-w64-headers/include/locale.h
index 686aa9b..6d464f0 100644
--- a/mingw-w64-headers/include/locale.h
+++ b/mingw-w64-headers/include/locale.h
@@ -16,8 +16,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/stddef.h b/mingw-w64-headers/include/stddef.h
index ad834e8..2b4033e 100644
--- a/mingw-w64-headers/include/stddef.h
+++ b/mingw-w64-headers/include/stddef.h
@@ -392,13 +392,17 @@
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
-#ifdef __GNUG__
+#if defined(__GNUG__) && __GNUG__ >= 3
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
+#ifndef _WIN64
#define NULL 0
+#else
+#define NULL 0LL
+#endif /* W64 */
#endif /* C++ */
#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
diff --git a/mingw-w64-headers/include/stdio.h b/mingw-w64-headers/include/stdio.h
index 6c90d00..23fb5d4 100644
--- a/mingw-w64-headers/include/stdio.h
+++ b/mingw-w64-headers/include/stdio.h
@@ -65,8 +65,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/stdlib.h b/mingw-w64-headers/include/stdlib.h
index 79a885b..c5a65e0 100644
--- a/mingw-w64-headers/include/stdlib.h
+++ b/mingw-w64-headers/include/stdlib.h
@@ -17,8 +17,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/string.h b/mingw-w64-headers/include/string.h
index 77db122..f85ea10 100644
--- a/mingw-w64-headers/include/string.h
+++ b/mingw-w64-headers/include/string.h
@@ -19,8 +19,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/tchar.h b/mingw-w64-headers/include/tchar.h
index dc1db67..f09be4f 100644
--- a/mingw-w64-headers/include/tchar.h
+++ b/mingw-w64-headers/include/tchar.h
@@ -1069,8 +1069,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/time.h b/mingw-w64-headers/include/time.h
index 5bd735d..918934c 100644
--- a/mingw-w64-headers/include/time.h
+++ b/mingw-w64-headers/include/time.h
@@ -87,8 +87,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/wchar.h b/mingw-w64-headers/include/wchar.h
index b45282a..8f18e81 100644
--- a/mingw-w64-headers/include/wchar.h
+++ b/mingw-w64-headers/include/wchar.h
@@ -140,8 +140,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif
diff --git a/mingw-w64-headers/include/windef.h b/mingw-w64-headers/include/windef.h
index f27c108..f776620 100644
--- a/mingw-w64-headers/include/windef.h
+++ b/mingw-w64-headers/include/windef.h
@@ -33,8 +33,12 @@
#ifndef NULL
#ifdef __cplusplus
+#ifndef _WIN64
#define NULL 0
#else
+#define NULL 0LL
+#endif /* W64 */
+#else
#define NULL ((void *)0)
#endif
#endif