diff --no-dereference -Naur -- gawk.normalized/builtin.c gawk.srctix/builtin.c --- gawk.normalized/builtin.c 2017-10-17 20:44:47.000000000 +0200 +++ gawk.srctix/builtin.c 2017-10-23 14:02:19.228454845 +0200 @@ -1192,10 +1192,18 @@ * Use snprintf return value to tell if there * is enough room in the buffer or not. */ +/* PATCH: Until Sortix has floating point printing. */ +#if defined(__sortix__) && !__SORTIX_HAS_FLOAT_PARSE__ + while ((i = snprintf(cpbufs[1].buf, + cpbufs[1].bufsize, "%lld", + (long long)tmpval)) >= + cpbufs[1].bufsize) { +#else while ((i = snprintf(cpbufs[1].buf, cpbufs[1].bufsize, "%.0f", tmpval)) >= cpbufs[1].bufsize) { +#endif if (cpbufs[1].buf == cpbufs[1].stackbuf) cpbufs[1].buf = NULL; if (i > 0) { diff --no-dereference -Naur -- gawk.normalized/extension/filefuncs.c gawk.srctix/extension/filefuncs.c --- gawk.normalized/extension/filefuncs.c 2017-09-17 19:35:53.000000000 +0200 +++ gawk.srctix/extension/filefuncs.c 2017-10-23 14:20:41.490845940 +0200 @@ -414,8 +414,12 @@ /* for block and character devices, add rdev, major and minor numbers */ if (S_ISBLK(sbuf->st_mode) || S_ISCHR(sbuf->st_mode)) { array_set_numeric(array, "rdev", sbuf->st_rdev); +#ifdef major array_set_numeric(array, "major", major(sbuf->st_rdev)); +#endif +#ifdef minor array_set_numeric(array, "minor", minor(sbuf->st_rdev)); +#endif } #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE diff --no-dereference -Naur -- gawk.normalized/io.c gawk.srctix/io.c --- gawk.normalized/io.c 2017-09-28 20:41:20.000000000 +0200 +++ gawk.srctix/io.c 2017-10-23 14:11:07.724176283 +0200 @@ -39,6 +39,8 @@ #include #endif /* HAVE_SYS_IOCTL_H */ +#include + #ifndef O_ACCMODE #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #endif diff --no-dereference -Naur -- gawk.normalized/main.c gawk.srctix/main.c --- gawk.normalized/main.c 2017-10-17 20:46:48.000000000 +0200 +++ gawk.srctix/main.c 2017-10-23 13:59:42.164103928 +0200 @@ -984,13 +984,7 @@ update_PROCINFO_num("api_minor", GAWK_API_MINOR_VERSION); #endif -#ifdef GETPGRP_VOID -#define getpgrp_arg() /* nothing */ -#else -#define getpgrp_arg() getpid() -#endif - - value = getpgrp(getpgrp_arg()); + value = getpgid(0); update_PROCINFO_num("pgrpid", value); /* diff --no-dereference -Naur -- gawk.normalized/node.c gawk.srctix/node.c --- gawk.normalized/node.c 2017-08-17 06:58:57.000000000 +0200 +++ gawk.srctix/node.c 2017-10-23 14:27:20.889566694 +0200 @@ -860,6 +860,8 @@ n->flags &= ~WSTRCUR; } +/* PATCH: Sortix doesn't have putwc(3) and this function is unused. */ +#if 0 static void __attribute__ ((unused)) dump_wstr(FILE *fp, const wchar_t *str, size_t len) { @@ -869,6 +871,7 @@ for (; len--; str++) putwc(*str, fp); } +#endif /* wstrstr --- walk haystack, looking for needle, wide char version */ diff --no-dereference -Naur -- gawk.normalized/support/getopt.c gawk.srctix/support/getopt.c --- gawk.normalized/support/getopt.c 2017-08-17 06:58:57.000000000 +0200 +++ gawk.srctix/support/getopt.c 2017-10-23 14:07:18.365504982 +0200 @@ -55,18 +55,9 @@ #ifndef ELIDE_CODE -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#if defined (__GNU_LIBRARY__) || defined (__CYGWIN__) || defined(__DJGPP__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__sun) /* Illumos */ -/* Don't include stdlib.h for - * non-GNU C libraries - * non-Cygwin - * non-DJGPP - * non-MinGW - * because some of them contain conflicting prototypes for getopt. */ +/* PATCH: #&%!ing gnu portability: You need stdlib.h for malloc. */ # include # include -#endif /* GNU C library. */ #include diff --no-dereference -Naur -- gawk.normalized/support/getopt.h gawk.srctix/support/getopt.h --- gawk.normalized/support/getopt.h 2017-08-17 06:58:57.000000000 +0200 +++ gawk.srctix/support/getopt.h 2017-10-23 14:09:07.278974591 +0200 @@ -1,3 +1,16 @@ +/* PATCH: Gawk doesn't seem to work with Sortix libc's getopt for some reason. + Gawk wants to use GNU getopt unconditionally. This causes conflicting + symbols, so rename gawk's replacements to avoid collisions. */ +#if defined(__sortix__) +#define getopt gawk_getopt +#define optarg gawk_optarg +#define optind gawk_optind +#define opterr gawk_opterr +#define optopt gawk_optopt +#define getopt_long gawk_getopt_long +#define getopt_long_only gawk_getopt_long_only +#define option gawk_option +#endif /* Declarations for getopt. Copyright (C) 1989-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --no-dereference -Naur -- gawk.normalized/tixbuildinfo gawk.srctix/tixbuildinfo --- gawk.normalized/tixbuildinfo 1970-01-01 01:00:00.000000000 +0100 +++ gawk.srctix/tixbuildinfo 2017-10-23 14:13:32.036823462 +0200 @@ -0,0 +1,6 @@ +tix.version=1 +tix.class=srctix +pkg.name=gawk +pkg.build-libraries=libiconv? libintl? libgmp? libmpfr? libreadline? +pkg.build-system=configure +pkg.post-install.cmd=tix-eradicate-libtool-la