delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/04/13:46:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.0.9.0.20040504133116.030ddad0@irispavp.igb.umontreal.ca>
X-Sender: bleau3 AT irispavp DOT igb DOT umontreal DOT ca (Unverified)
Date: Tue, 04 May 2004 13:46:25 -0400
To: cygwin AT cygwin DOT com
From: Andre Bleau <bleau AT igb DOT umontreal DOT ca>
Subject: Patch for robots 2.0-3
Mime-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i44HkmGd021638

I've noticed that robots 2.0-3 fails to update its high score files with 
cygwin 1.5.x. Debugging shows that the bug is related to lseek. Searching 
the archives, I found this message from cgf:

http://www.cygwin.com/ml/cygwin/2003-07/msg01677.html


>And here's why "fails.c" fails:
>
>--- lseek-fails.c~      2003-07-29 11:43:29.428769079 -0400
>+++ lseek-fails.c       2003-07-29 11:46:01.911652780 -0400
>@@ -1,4 +1,5 @@
>  #include <stdio.h>
>+#include <unistd.h>
>
>  void unzip()
>  {
>
>You need to include the prototype for lseek.
>
>cgf

So, here's a patch to robots.h to do just that:
$ diff -u robots.h robots.h.new
--- robots.h    2003-07-18 11:23:57.001000000 -0400
+++ robots.h.new        2004-05-04 13:23:50.407687000 -0400
@@ -96,7 +96,11 @@
  extern int     old_free;

  extern long    score;
-extern long    lseek();
+#ifdef __CYGWIN__
+#include <unistd.h>
+#else
+extern long    lseek();
+#endif

  extern char    *strcpy ();
  extern char    *strncpy ();

Now I'm back to the top 20 robot killers of all time (on my machine):

$ ./robots


Top Twenty Scores for this Week:
Rank   Score    Name
 >  1        20   ableau: chickened out on level 1.<
[Press return to continue]

Top Twenty Scores of All Time:
Rank   Score    Name
 >  1        20   ableau: chickened out on level 1.<

;-)



André Bleau, Cygwin's OpenGL package maintainer.

Please address all questions and problem reports about Cygwin's OpenGL 
package to cygwin at cygwin dot com . 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019