Module Name: src Committed By: plunky Date: Wed Aug 10 08:09:38 UTC 2011
Modified Files: src/external/bsd/pcc/dist/pcc/mip: common.c Log Message: use offsetof() rather than rolling our own, to appease gcc 4.5 To generate a diff of this commit: cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/pcc/dist/pcc/mip/common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/pcc/dist/pcc/mip/common.c diff -u src/external/bsd/pcc/dist/pcc/mip/common.c:1.1.1.3 src/external/bsd/pcc/dist/pcc/mip/common.c:1.2 --- src/external/bsd/pcc/dist/pcc/mip/common.c:1.1.1.3 Thu Jun 3 18:57:53 2010 +++ src/external/bsd/pcc/dist/pcc/mip/common.c Wed Aug 10 08:09:38 2011 @@ -1,5 +1,5 @@ /* Id: common.c,v 1.92 2010/03/27 23:46:12 mickey Exp */ -/* $NetBSD: common.c,v 1.1.1.3 2010/06/03 18:57:53 plunky Exp $ */ +/* $NetBSD: common.c,v 1.2 2011/08/10 08:09:38 plunky Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ra...@ludd.luth.se). * All rights reserved. @@ -60,6 +60,7 @@ */ #include <stdarg.h> +#include <stddef.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -470,7 +471,7 @@ } a2; }; -#define ALIGNMENT ((long)&((struct balloc *)0)->a2) +#define ALIGNMENT offsetof(struct balloc, a2) #define ROUNDUP(x) (((x) + ((ALIGNMENT)-1)) & ~((ALIGNMENT)-1)) static char *allocpole;