PATCH: /dlls/ntdll/cdrom.c -- portability breakage

Gerald Pfeifer pfeifer at dbai.tuwien.ac.at
Thu Feb 20 03:29:31 CST 2003


The following patch broke FreeBSD (and other non-Linux system) in three
places:

  revision 1.25
  date: 2003/02/19 22:08:50;  author: julliard;  state: Exp;  lines: +433 -180
  Waldeck Schutzer <schutzer at math.rutgers.edu>
  - Some systems/drives are very slow to read the TOC. To address this
    issue, we are caching it inside the driver.
  - Windows will seek while not playing, Linux will not. We are
    providing better compatibility with Windows by also caching the
    current position.

My patch below fixes two of these.

Gerald


ChangeLog:
  Define CD_SECS and CD_FRAMES also on non-Linux systems.  Avoid a
  non-portable TRACE on non-Linux systems.

Index: cdrom.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/cdrom.c,v
retrieving revision 1.25
diff -u -3 -p -r1.25 cdrom.c
--- cdrom.c	19 Feb 2003 22:08:50 -0000	1.25
+++ cdrom.c	20 Feb 2003 09:24:43 -0000
@@ -72,6 +72,15 @@
 #include "file.h"
 #include "wine/debug.h"

+/* Non-Linux systems do not have linux/cdrom.h and the like, and thus
+   lack the following constants. */
+
+#ifndef CD_SECS
+  #define CD_SECS              60 /* seconds per minute */
+#endif
+#ifndef CD_FRAMES
+  #define CD_FRAMES            75 /* frames per second */
+#endif

 static const struct iocodexs
 {
@@ -285,8 +294,10 @@ static int CDROM_SyncCache(int dev)
         + sizeof(TRACK_DATA) * (toc->LastTrack-toc->FirstTrack+2);
     toc->Length[0] = tsz >> 8;
     toc->Length[1] = tsz;
-
+
+#ifdef linux
     TRACE("caching toc from=%d to=%d\n", hdr.cdth_trk0, hdr.cdth_trk1);
+#endif

     for (i = toc->FirstTrack; i <= toc->LastTrack + 1; i++)
     {



More information about the wine-patches mailing list