[BACK]Return to patch-gen.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / sr / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / sr / patches / patch-gen.h (download)

Revision 1.1, Wed Apr 18 08:42:16 2018 UTC (4 years, 11 months ago) by he
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, HEAD

Modernize this so that it builds again (after SSP), and
do the context-shifting in a non-MI manner so it may work
on other ports than i386.

$NetBSD: patch-gen.h,v 1.1 2018/04/18 08:42:16 he Exp $

If using modern C compiler, use header files instead of
attempting to predeclare C library functions.

--- gen.h.orig	1999-07-28 20:42:21.000000000 +0000
+++ gen.h
@@ -32,9 +32,15 @@
  *  Don't use protoypes here; increases conflicts with system include files.
+#if defined(__STDC__) || defined(__sgi) || defined(_AIX) || defined(__alpha)
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
 char *getenv(), *getcwd();
 char *strcat(), *strncat(), *strchr(), *strrchr(), *strcpy(), *strncpy();
 void exit();
 /* int functions are not explicitly defined -- use implicit definitions */
 /* This avoids conflicts on Solaris (at least) where strlen is a size_t fn */
@@ -43,8 +49,9 @@ void exit();
 double fmod();	/* not in Sequent <math.h> */
 #if defined(__STDC__) || defined(__sgi) || defined(_AIX) || defined(__alpha)
-void *malloc(), *realloc();
-void *memset(), *memcpy();
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
 char *malloc(), *realloc();
 char *memset(), *memcpy();