Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #15072
| From | thomas <freshthomas@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | macro definition for different compile configurations |
| Date | 2012-03-27 00:29 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <26170974.62.1332833351847.JavaMail.geo-discussion-forums@ynel5> (permalink) |
Hi,
I'm stucked by something appears really simple at first sight.
I have a function definition with different parameter list in different compile configurations. for example.
--------------------------
CONF1:
int f(int x, int y){}
int g(int x){}
CONF2:
int f(int y){}
int g(){}
----------------------------
I'm trying to define some marco like
#if CONF1
#define PARAM(list) int x, list
#elseif CONF2
#define PARAM(list) list
#endif
But it cannot work for func g() definition in CONF1 since a "," is appended unexpectedly.
It seems to be really simple, but I am now a little dumb how to define one and solve it elegantly.
thanks.
tom
Back to comp.lang.c++ | Previous | Next — Next in thread | Find similar | Unroll thread
macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 00:29 -0700
Re: macro definition for different compile configurations Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-27 07:58 -0400
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 06:44 -0700
Re: macro definition for different compile configurations Qi <no@no.com> - 2012-03-27 21:53 +0800
Re: macro definition for different compile configurations Juha Nieminen <nospam@thanks.invalid> - 2012-03-27 17:31 +0000
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 07:05 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 09:49 -0700
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 11:27 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 11:46 -0700
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 12:39 -0700
Re: macro definition for different compile configurations Ian Collins <ian-news@hotmail.com> - 2012-03-28 08:49 +1300
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 12:58 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 15:50 -0700
Re: macro definition for different compile configurations Juha Nieminen <nospam@thanks.invalid> - 2012-03-28 08:14 +0000
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-28 07:30 -0700
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 18:00 -0700
csiph-web