Module Name: src Committed By: christos Date: Sat May 5 15:04:58 UTC 2012
Modified Files: src/lib/libossaudio: soundcard.h Log Message: avoid using cpp variadic macros and explain why. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libossaudio/soundcard.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libossaudio/soundcard.h diff -u src/lib/libossaudio/soundcard.h:1.20 src/lib/libossaudio/soundcard.h:1.21 --- src/lib/libossaudio/soundcard.h:1.20 Fri May 4 07:48:12 2012 +++ src/lib/libossaudio/soundcard.h Sat May 5 11:04:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: soundcard.h,v 1.20 2012/05/04 11:48:12 christos Exp $ */ +/* $NetBSD: soundcard.h,v 1.21 2012/05/05 15:04:57 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -291,24 +291,18 @@ typedef struct buffmem_desc { int size; } buffmem_desc; -#if 0 -/* This is what we'd like to have, but it causes prototype conflicts. */ #define ioctl _oss_ioctl -#else /* - * XXX force inclusion of <sys/ioctl.h> before we redefine - * ioctl() to avoid a prototype conflict. - * Its multiple inclusion protection will keep this from - * happening if it is pulled in later. + * If we already included <sys/ioctl.h>, then we define our own prototype, + * else we depend on <sys/ioctl.h> to do it for us. We do it this way, so + * that we don't define the prototype twice. */ +#ifndef _SYS_IOCTL_H #include <sys/ioctl.h> -#define ioctl(x, y, ...) _oss_ioctl(x, y, __VA_ARGS__) -#endif - -#include <sys/cdefs.h> - +#else __BEGIN_DECLS int _oss_ioctl(int, unsigned long, ...); __END_DECLS +#endif #endif /* !_SOUNDCARD_H_ */