Skip to content

Commit d0add1f

Browse files
committed
tailib: switch to unit64_t
This gets rid of tryulong64.c, a buildtime configure binary which interferes with cross-compilation, at the cost of bumping the minimum C version to C99.
1 parent 124f8ff commit d0add1f

9 files changed

Lines changed: 20 additions & 58 deletions

File tree

src/Makefile

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
236236
iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c
237237
./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
238238

239-
iopause.o: iopause.c iopause.h select.h tai.h taia.h uint64.h
239+
iopause.o: iopause.c iopause.h select.h tai.h taia.h
240240
$(CC) $(CFLAGS) -c iopause.c
241241

242242
load: conf-ld print-ld.sh warn-auto.sh
@@ -363,56 +363,55 @@ subgetopt.o: subgetopt.c subgetopt.h
363363

364364
sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \
365365
hassgprm.h haswaitp.h iopause.h load select.h \
366-
uint64.h reboot_system.h uw_tmp.h socket.lib
366+
reboot_system.h uw_tmp.h socket.lib
367367
rm -f sysdeps
368368
cat compile load socket.lib >>sysdeps
369369
grep sysdep direntry.h >>sysdeps
370370
grep sysdep haswaitp.h >>sysdeps
371371
grep sysdep hassgact.h >>sysdeps
372372
grep sysdep hassgprm.h >>sysdeps
373373
grep sysdep select.h >>sysdeps
374-
grep sysdep uint64.h >>sysdeps
375374
grep sysdep iopause.h >>sysdeps
376375
grep sysdep hasmkffo.h >>sysdeps
377376
grep sysdep hasflock.h >>sysdeps
378377
grep sysdep reboot_system.h >>sysdeps
379378
grep sysdep uw_tmp.h >>sysdeps
380379
cat sysdeps
381380

382-
tai_now.o: tai.h tai_now.c uint64.h
381+
tai_now.o: tai.h tai_now.c
383382
$(CC) $(CFLAGS) -c tai_now.c
384383

385-
tai_pack.o: tai.h tai_pack.c uint64.h
384+
tai_pack.o: tai.h tai_pack.c
386385
$(CC) $(CFLAGS) -c tai_pack.c
387386

388-
tai_sub.o: tai.h tai_sub.c uint64.h
387+
tai_sub.o: tai.h tai_sub.c
389388
$(CC) $(CFLAGS) -c tai_sub.c
390389

391-
tai_unpack.o: tai.h tai_unpack.c uint64.h
390+
tai_unpack.o: tai.h tai_unpack.c
392391
$(CC) $(CFLAGS) -c tai_unpack.c
393392

394-
taia_add.o: tai.h taia.h taia_add.c uint64.h
393+
taia_add.o: tai.h taia.h taia_add.c
395394
$(CC) $(CFLAGS) -c taia_add.c
396395

397-
taia_approx.o: tai.h taia.h taia_approx.c uint64.h
396+
taia_approx.o: tai.h taia.h taia_approx.c
398397
$(CC) $(CFLAGS) -c taia_approx.c
399398

400-
taia_frac.o: tai.h taia.h taia_frac.c uint64.h
399+
taia_frac.o: tai.h taia.h taia_frac.c
401400
$(CC) $(CFLAGS) -c taia_frac.c
402401

403-
taia_less.o: tai.h taia.h taia_less.c uint64.h
402+
taia_less.o: tai.h taia.h taia_less.c
404403
$(CC) $(CFLAGS) -c taia_less.c
405404

406-
taia_now.o: tai.h taia.h taia_now.c uint64.h
405+
taia_now.o: tai.h taia.h taia_now.c
407406
$(CC) $(CFLAGS) -c taia_now.c
408407

409-
taia_pack.o: tai.h taia.h taia_pack.c uint64.h
408+
taia_pack.o: tai.h taia.h taia_pack.c
410409
$(CC) $(CFLAGS) -c taia_pack.c
411410

412-
taia_sub.o: tai.h taia.h taia_sub.c uint64.h
411+
taia_sub.o: tai.h taia.h taia_sub.c
413412
$(CC) $(CFLAGS) -c taia_sub.c
414413

415-
taia_uint.o: tai.h taia.h taia_uint.c uint64.h
414+
taia_uint.o: tai.h taia.h taia_uint.c
416415
$(CC) $(CFLAGS) -c taia_uint.c
417416

418417
time.a: iopause.o makelib tai_now.o tai_pack.o tai_sub.o tai_unpack.o \
@@ -422,9 +421,6 @@ taia_pack.o taia_sub.o taia_uint.o
422421
tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o \
423422
taia_now.o taia_pack.o taia_sub.o taia_uint.o
424423

425-
uint64.h: choose compile load tryulong64.c uint64.h1 uint64.h2
426-
./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
427-
428424
unix.a: alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
429425
buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \
430426
error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \

src/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ taia_pack.o
119119
taia_sub.o
120120
taia_uint.o
121121
time.a
122-
uint64.h
123122
unix.a
124123
wait_nohang.o
125124
wait_pid.o

src/runsvdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int main(int argc, char **argv) {
233233
dev =s.st_dev;
234234
ino =s.st_ino;
235235
check =0;
236-
if (now.sec.x <= (4611686018427387914ULL +(uint64)mtime))
236+
if (now.sec.x <= (4611686018427387914ULL +(uint64_t)mtime))
237237
sleep(1);
238238
runsvdir();
239239
while (fchdir(curdir) == -1) {

src/tai.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#ifndef TAI_H
44
#define TAI_H
55

6-
#include "uint64.h"
6+
#include <stdint.h>
77

88
struct tai {
9-
uint64 x;
9+
uint64_t x;
1010
} ;
1111

12-
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64) (u)))
12+
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64_t) (u)))
1313

1414
extern void tai_now(struct tai *);
1515

src/tai_pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void tai_pack(char *s,const struct tai *t)
66
{
7-
uint64 x;
7+
uint64_t x;
88

99
x = t->x;
1010
s[7] = x & 255; x >>= 8;

src/tai_unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void tai_unpack(const char *s,struct tai *t)
66
{
7-
uint64 x;
7+
uint64_t x;
88

99
x = (unsigned char) s[0];
1010
x <<= 8; x += (unsigned char) s[1];

src/tryulong64.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/uint64.h1

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/uint64.h2

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)