More declspecs.

[SVN r23280]
This commit is contained in:
Vladimir Prus 2004-06-30 07:16:09 +00:00
parent 82ecb460b3
commit 7a614e26ef
5 changed files with 32 additions and 28 deletions

View File

@ -51,6 +51,9 @@
// for mbstate_t
#include <cwchar>
#include <boost/program_options/config.hpp>
#define DECL BOOST_PROGRAM_OPTIONS_DECL
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(__ICL, <= 700) || BOOST_WORKAROUND(_MSC_VER, <= 1200)
@ -67,7 +70,7 @@ namespace std
namespace boost { namespace program_options { namespace detail {
struct utf8_codecvt_facet_wchar_t :
struct DECL utf8_codecvt_facet_wchar_t :
public std::codecvt<wchar_t, char, std::mbstate_t>
{
public:
@ -192,7 +195,7 @@ struct utf8_codecvt_facet
{};
template<>
struct utf8_codecvt_facet<wchar_t, char>
struct DECL utf8_codecvt_facet<wchar_t, char>
: public utf8_codecvt_facet_wchar_t
{};

View File

@ -8,7 +8,7 @@
namespace boost { namespace program_options {
extern std::string arg;
extern DECL std::string arg;
template<class T, class charT>
std::string
@ -57,7 +57,7 @@ namespace boost { namespace program_options {
}
/* Throws multiple_occurences if 'value' is not empty. */
void check_first_occurence(const boost::any& value);
DECL void check_first_occurence(const boost::any& value);
}
using namespace validators;
@ -85,15 +85,15 @@ namespace boost { namespace program_options {
}
}
void validate(boost::any& v,
const std::vector<std::string>& xs,
bool*,
int);
DECL void validate(boost::any& v,
const std::vector<std::string>& xs,
bool*,
int);
void validate(boost::any& v,
const std::vector<std::wstring>& xs,
bool*,
int);
DECL void validate(boost::any& v,
const std::vector<std::wstring>& xs,
bool*,
int);
// For some reason, this declaration, which is require by the standard,
// cause gcc 3.2 to not generate code to specialization defined in
@ -102,15 +102,15 @@ namespace boost { namespace program_options {
BOOST_WORKAROUND(__GNUC_MINOR__, < 3) ) || \
( BOOST_WORKAROUND(BOOST_MSVC, == 1310) ) \
)
void validate(boost::any& v,
const std::vector<std::string>& xs,
std::string*,
int);
DECL void validate(boost::any& v,
const std::vector<std::string>& xs,
std::string*,
int);
void validate(boost::any& v,
const std::vector<std::wstring>& xs,
std::string*,
int);
DECL void validate(boost::any& v,
const std::vector<std::wstring>& xs,
std::string*,
int);
#endif
/** Validates sequences. Allows multiple values per option occurence

View File

@ -142,7 +142,7 @@ namespace boost { namespace program_options {
/** Parse a config file.
*/
template<class charT>
DECL basic_parsed_options<charT>
basic_parsed_options<charT>
parse_config_file(std::basic_istream<charT>&, const options_description&);
/** Parse environment.

View File

@ -10,6 +10,7 @@
#include <cstdlib> // for multi-byte converson routines
#include <cassert>
#define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/detail/utf8_codecvt_facet.hpp>
namespace boost { namespace program_options { namespace detail {

View File

@ -62,7 +62,7 @@ namespace boost { namespace program_options {
}
#endif
string arg("arg");
DECL string arg("arg");
std::string
untyped_value::name() const
@ -103,8 +103,8 @@ namespace boost { namespace program_options {
Case is ignored. Regardless of name passed, parameter will always
be optional.
*/
void validate(any& v, const vector<string>& xs,
bool*, int)
DECL void validate(any& v, const vector<string>& xs,
bool*, int)
{
check_first_occurence(v);
string s(get_single_string(xs, true));
@ -124,7 +124,7 @@ namespace boost { namespace program_options {
// since wstring can't be constructed/compared with char*. We'd need to
// create auxilliary 'widen' routine to convert from char* into
// needed string type, and that's more work.
void validate(any& v, const vector<wstring>& xs, bool*, int)
DECL void validate(any& v, const vector<wstring>& xs, bool*, int)
{
check_first_occurence(v);
wstring s(get_single_string(xs, true));
@ -140,7 +140,7 @@ namespace boost { namespace program_options {
throw validation_error("invalid bool value");
}
void validate(any& v, const vector<string>& xs, std::string*, int)
DECL void validate(any& v, const vector<string>& xs, std::string*, int)
{
check_first_occurence(v);
string s(get_single_string(xs));
@ -151,7 +151,7 @@ namespace boost { namespace program_options {
v = any(s);
}
void validate(any& v, const vector<wstring>& xs, std::string*, int)
DECL void validate(any& v, const vector<wstring>& xs, std::string*, int)
{
check_first_occurence(v);
wstring s(get_single_string(xs));
@ -165,7 +165,7 @@ namespace boost { namespace program_options {
namespace validators {
void check_first_occurence(const boost::any& value)
DECL void check_first_occurence(const boost::any& value)
{
if (!value.empty())
throw multiple_occurences("multiple_occurences");