From 3d582fa82009836185b94f69ad68a094654b48bc Mon Sep 17 00:00:00 2001 From: obache Date: Tue, 4 Sep 2007 09:47:38 +0000 Subject: Ensure undef before typedef, to avoid error when a application detect missing types by itself and define (ex, pkgtools/pkg_install). --- pkgtools/libnbcompat/files/bits.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/libnbcompat/files/bits.c b/pkgtools/libnbcompat/files/bits.c index a0561e2c41f..9d3842a2304 100644 --- a/pkgtools/libnbcompat/files/bits.c +++ b/pkgtools/libnbcompat/files/bits.c @@ -1,4 +1,4 @@ -/* $NetBSD: bits.c,v 1.6 2003/09/13 03:50:12 jlam Exp $ */ +/* $NetBSD: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $ */ /* * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan @@ -35,7 +35,7 @@ #include "nbcompat/config.h" #if 0 -__RCSID("$NetBSD: bits.c,v 1.6 2003/09/13 03:50:12 jlam Exp $"); +__RCSID("$NetBSD: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $"); #endif #include #include @@ -51,6 +51,7 @@ __RCSID("$NetBSD: bits.c,v 1.6 2003/09/13 03:50:12 jlam Exp $"); int tabs; \ sprintf(tmp, "%sint%d_t" , pre, len); \ sprintf(tmp2, "typedef %s %s;", #TYPE, tmp); \ + fprintf(f, "#undef %s\n", tmp); \ tabs = 5 - strlen(tmp2) / 8; \ fprintf(f, "%s", tmp2); \ while(tabs-- > 0) fprintf(f, "\t"); \ @@ -129,7 +130,7 @@ int main(int argc, char **argv) } fprintf(f, "/* %s -- this file was generated by\n", fn); fprintf(f, " %*s %s */\n\n", (int)strlen(fn), "", - "$Id: bits.c,v 1.6 2003/09/13 03:50:12 jlam Exp $"); + "$Id: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $"); fprintf(f, "#ifndef %s\n", hb); fprintf(f, "#define %s\n", hb); fprintf(f, "\n"); -- cgit v1.2.3