home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!tcsi.com!iat.holonet.net!news.cerf.net!usc!cs.utexas.edu!sun-barr!news2me.EBay.Sun.COM!male.EBay.Sun.COM!loopkill!pauln
- From: pauln@loopkill.EBay.Sun.COM (Paul Nguyen)
- Newsgroups: comp.lang.c++
- Subject: Re: Clashes between <stdarg.h> and <varargs.h>
- Date: 27 Jan 1993 18:33:27 GMT
- Organization: Sun Microsystems, Inc.
- Lines: 41
- Distribution: world
- Message-ID: <1k6khoINNqoi@male.EBay.Sun.COM>
- References: <1993Jan27.085907.894@walter.cray.com>
- Reply-To: pauln@loopkill.EBay.Sun.COM
- NNTP-Posting-Host: loopkill.ebay.sun.com
-
- In article 894@walter.cray.com, ssh@cray.com (Steven Hein) writes:
- > I am writing a user interface in C++ using the XView toolkit. But, I'm having a
- > problem using stdarg.h and varargs in the same source file (XView uses varargs and I
- > need to include some XView header files in this source). Can anyone tell me:
- >
- > a) how to make stdarg and varargs cooperate in the same C++ source file
- >
- > OR
- >
- > b) how to use varargs to implement a C++ member function declared like this:
- >
- > void xxx::output(char* fmt, ...);
- >
- > I don't need to parse the argument list--I just need to pass it to vsprintf() or
- > to vfprintf().
- >
- > Any help would be appreciated--I'm at my wit's end with this one...Also, I'm a newbie
- > with this 'news' thing, so please email me any suggestions so I'm sure to get them!
- >
- > Thanks!
- >
- > ----
- > Steve Hein
- > Cray Research, Inc.
- > tel. (715) 726-5525
- > email: ssh@cray.com
- >
-
- Steve,
- I ran into the same problem when I was trying to create a constructor with
- variable argument lists. My work around is below:
-
- /* Variable args includes */
- #include <stdarg.h>
- #define _sys_varargs_h /* prevent /usr/include/varargs.h */
- #define VARARGSH /* prevent ...CC/incl/varargs.h */
-
-
- Paul
-
-
-