Use the definition in <sys/param.h> instead of redefining MAX().
(Used to work because the redefinition was identical to the original definition, but no longer.) While I'm here, define sizeofA() in terms of __arraycount() from <sys/cdefs.h>.
This commit is contained in:
parent
2be246d2b7
commit
4ec9bd2b05
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: c.h,v 1.5 2007/12/20 20:12:12 christos Exp $ */
|
||||
/* $NetBSD: c.h,v 1.6 2009/06/19 23:36:41 dyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991 Carnegie Mellon University
|
||||
|
@ -56,7 +56,8 @@
|
|||
#ifndef _C_INCLUDE_
|
||||
#define _C_INCLUDE_
|
||||
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
|
@ -65,7 +66,7 @@
|
|||
#define TRUE 1
|
||||
#endif /* TRUE */
|
||||
|
||||
#define sizeofA(array) (sizeof(array)/sizeof(array[0]))
|
||||
#define sizeofA(array) __arraycount(array)
|
||||
|
||||
#ifndef __unused
|
||||
#ifndef __GNUC__
|
||||
|
|
Loading…
Reference in New Issue