Fix ntdll test compilation on Windows

Francois Gouget fgouget at free.fr
Thu Oct 28 19:26:39 CDT 2004


TIME_FIELDS is not defined in the Windows SDK. However it is defined in 
ddk/ntddk.h in the DDK. But since we don't want the conformance tests to 
depend on the DDK we cannot use that definition.

So I applied the solution that was used for rtlbitmap.c: put a big 
'#ifdef __WINE_WINTERNL_H' around the tests. This lets the conformance 
tests compile and link with the Platform SDK, albeit with reduced 
functionality.


Changelog:

  * dlls/ntdll/tests/time.c

    #ifdef out the tests if compiling with the Platform SDK headers since 
they are missing TIME_FIELDS.


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
            Cahn's Axiom: When all else fails, read the instructions.
-------------- next part --------------
Index: dlls/ntdll/tests/time.c
===================================================================
RCS file: /var/cvs/wine/dlls/ntdll/tests/time.c,v
retrieving revision 1.1
diff -u -r1.1 time.c
--- dlls/ntdll/tests/time.c	22 Oct 2004 19:54:17 -0000	1.1
+++ dlls/ntdll/tests/time.c	28 Oct 2004 14:21:45 -0000
@@ -18,7 +18,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "ntdll_test.h"
+#include "ntdll_test.h"
+
+#ifdef __WINE_WINTERNL_H
+
 #define TICKSPERSEC        10000000
 #define TICKSPERMSEC       10000
 #define SECSPERDAY         86400
@@ -79,11 +82,14 @@
         litime.QuadPart +=  (LONGLONG) tftest.Day * TICKSPERSEC * SECSPERDAY;
     }
 }
+#endif
 
 START_TEST(time)
 {
+#ifdef __WINE_WINTERNL_H
     HMODULE mod = GetModuleHandleA("ntdll.dll");
     pRtlTimeToTimeFields = (void *)GetProcAddress(mod,"RtlTimeToTimeFields");
     if (pRtlTimeToTimeFields)
         test_pRtlTimeToTimeFields();
+#endif
 }


More information about the wine-patches mailing list