avoid using cpp variadic macros and explain why.

This commit is contained in:
christos 2012-05-05 15:04:57 +00:00
parent 648feb69e9
commit 2cb8b46c96
1 changed files with 7 additions and 13 deletions

View File

@ -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_ */