-
Notifications
You must be signed in to change notification settings - Fork 0
/
Porting
89 lines (76 loc) · 2.24 KB
/
Porting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
From uknet!bjesomar.srce.hr!alex Thu Jan 19 11:25:27 1995
Return-Path: <uknet!bjesomar.srce.hr!alex>
From: [email protected] (Aleksandar Milivojevic)
Subject: Re: Tetris
To: [email protected] (Mike Taylor)
Date: Thu, 19 Jan 1995 12:23:10 +0100 (NFT)
In-Reply-To: <[email protected]> from "Mike Taylor" at Jan 17, 95 04:39:52 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: 8bit
Content-Length: 1795
Ok, I compiled it on both AIX and Ultrix... Here are changes which I needed
in order to compile it:
On AIX:
In Makefile:
Changed CFLAGS to: CFLAGS = $(OPT) -DAIX
Changed LDLIBS to: LDLIBS = -lcurses
In tt.c:
Changed:
#ifdef SYSV
extern int sprintf ();
#else /*SYSV*/
extern char *sprintf ();
#endif /*SYSV*/
To:
#ifndef AIX
#ifdef SYSV
extern int sprintf ();
#else /*SYSV*/
extern char *sprintf ();
#endif /*SYSV*/
#endif /* AIX */
On Ultrix:
There is no usleep function, so I needed to add one.
In Makefile:
Changed SRC to: SRC = tt.c utils.c screen.c pieces.c game.c usleep.c
I grabbed usleep.c from xpilot source ;-)
So here it is:
usleep.c:
------------------------ 8< Cut here 8< ----------------------
/*
#ifndef lint
static char sccsid[] = "@(#)usleep.c 1.3 91/05/24 XLOCK";
#endif
*/
/*-
* usleep.c - OS dependant implementation of usleep().
*
* Copyright (c) 1991 by Patrick J. Naughton.
*
* Revision History:
* 30-Aug-90: written.
*
*/
#include <sys/types.h>
#include <sys/time.h>
#ifndef lint
static char sourceid[] =
"@(#)$Id: Porting,v 1.1.1.1 2003-05-27 10:46:19 mike Exp $";
#endif
void usleep(unsigned long usec)
{
#if 0 /* SYSV */
poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms RES */
#endif
struct timeval timeout;
timeout.tv_usec = usec % (unsigned long) 1000000;
timeout.tv_sec = usec / (unsigned long) 1000000;
(void) select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
}
------------------------ 8< Cut here 8< ----------------------
--
CAHN'S AXIOM: | Aleksandar Milivojevic | mail: Jakova Gotovca 5
When all else fails, | ---------------------- | 54520 Slatina
read the instructions. | e-mail: [email protected] | Croatia