Boost logo

Boost Users :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-05-21 22:06:43


Cory Nelson wrote:
> Doesn't have to do with boost but this seems like the croud that would
> know how to do this.
>
> I have the code:
>
> #ifdef _WIN32_WINNT
> #ifdef _WIN64
> #define BUILDTYPE 3000000
> #else
> #define BUILDTYPE 1000000
> #endif
> #else
> #define BUILDTYPE 2000000
> #endif
>
> #define BUILDDATE 50521
> #define BUILDNUM (BUILDTYPE+BUILDDATE)
>
> and would like to stringify the value of BUILDNUM into say "2050521"
> in the preprocessor. Is there a way to do this (in vc7.1)?

#define BUILDTYPE_1000000 10
#define BUILDTYPE_2000000 20
#define BUILDTYPE_3000000 30
#define BUILDNUM_STRING \
   BOOST_STRINGIZE(BUILDTYPE_##BUILDTYPE) \
   BOOST_STRINGIZE(BUILDDATE)

Or something like that.. You can look up what BOOST_STRINGIZE does on
you own ;-)

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net