Boost logo

Boost Users :

Subject: Re: [Boost-users] Help with updating PowerDNS to boost for easier windows compilation
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-07-25 01:19:01


AMDG

Todd Nine wrote:
> I'm in the process of updating the 2.9.22 source of PowerDNS to be a
> bit more "Windows Friendly" and building it with Visual C++ 8 (2008).
> However, I'm having some issues I could use a hand with.
> Specifically, the authors of powerdns define their own following types
>
> #ifdef NEED_POSIX_TYPEDEF
> typedef unsigned char uint8_t;
> typedef unsigned short int uint16_t;
> typedef unsigned int uint32_t;
> typedef unsigned long long uint64_t;
> #endif
>
> These types are used extensively in the code. Rather than prefix each
> reference with the boost:: namspace, I would like to make boot the
> standard namespace for these data types.

Does this do what you want?

#ifdef NEED_POSIX_TYPEDEF
#include <boost/cstdint.hpp>
using boost::unit8_t;
using boost::uint16_t;
using boost::uint32_t;
using boost::uint64_t;
#endif

This is a little tricky because if you platform already
has stdint.h, these typedefs will already be defined
in the global namespace so redefining them is an
error.

> Everything includes the header file with the definition above, is
> there a way for me to do this? I haven't done C and C++ in 9 years,
> and even then only on very small projects and small patches, so your
> help is greatly appreciated.

In Christ,
Steven Watanabe


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