VC6 compilation fix for _WX_VARARG_FORMAT_STRING macro
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -124,6 +124,11 @@ class WXDLLIMPEXP_FWD_BASE wxString;
|
|||||||
// accounts for string changes done by wxArgNormalizer<>
|
// accounts for string changes done by wxArgNormalizer<>
|
||||||
//
|
//
|
||||||
// Note that this class can _only_ be used for function arguments!
|
// Note that this class can _only_ be used for function arguments!
|
||||||
|
#ifdef __VISUALC__
|
||||||
|
// "struct 'wx[W]CharBuffer<T>' needs to have dll-interface to be used by
|
||||||
|
// clients of class 'wxString'" - this is private, we don't care
|
||||||
|
#pragma warning (disable:4251)
|
||||||
|
#endif
|
||||||
class WXDLLIMPEXP_BASE wxFormatString
|
class WXDLLIMPEXP_BASE wxFormatString
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -178,11 +183,6 @@ private:
|
|||||||
#endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
|
#endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef __VISUALC__
|
|
||||||
// "struct 'ConvertedBuffer<T>' needs to have dll-interface to be used by
|
|
||||||
// clients of class 'wxString'" - this is private, we don't care
|
|
||||||
#pragma warning (disable:4251)
|
|
||||||
#endif
|
|
||||||
wxCharBuffer m_char;
|
wxCharBuffer m_char;
|
||||||
wxWCharBuffer m_wchar;
|
wxWCharBuffer m_wchar;
|
||||||
#ifdef __VISUALC__
|
#ifdef __VISUALC__
|
||||||
@@ -217,16 +217,27 @@ struct wxFormatStringArgument
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline wxFormatStringArgument wxFindFormatStringArgument(T WXUNUSED(arg))
|
struct wxFormatStringArgumentFinder
|
||||||
{
|
{
|
||||||
|
static wxFormatStringArgument find(T)
|
||||||
|
{
|
||||||
// by default, arguments are not format strings, so return "not found"
|
// by default, arguments are not format strings, so return "not found"
|
||||||
return wxFormatStringArgument();
|
return wxFormatStringArgument();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
inline wxFormatStringArgument
|
template<>
|
||||||
wxFindFormatStringArgument(const wxFormatString& arg)
|
struct wxFormatStringArgumentFinder<const wxFormatString&>
|
||||||
{
|
{
|
||||||
return wxFormatStringArgument(&arg);
|
static wxFormatStringArgument find(const wxFormatString& arg)
|
||||||
|
{ return wxFormatStringArgument(&arg); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct wxFormatStringArgumentFinder<wxFormatString>
|
||||||
|
{
|
||||||
|
static wxFormatStringArgument find(const wxFormatString& arg)
|
||||||
|
{ return wxFormatStringArgument(&arg); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -715,6 +726,15 @@ private:
|
|||||||
#define _WX_VARARG_FIXED_UNUSED_EXPAND_4(t1,t2,t3,t4) \
|
#define _WX_VARARG_FIXED_UNUSED_EXPAND_4(t1,t2,t3,t4) \
|
||||||
t1 WXUNUSED(f1), t2 WXUNUSED(f2), t3 WXUNUSED(f3), t4 WXUNUSED(f4)
|
t1 WXUNUSED(f1), t2 WXUNUSED(f2), t3 WXUNUSED(f3), t4 WXUNUSED(f4)
|
||||||
|
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS_1(t1) \
|
||||||
|
typedef t1 TF1
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS_2(t1,t2) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS_1(t1); typedef t2 TF2
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS_3(t1,t2,t3) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS_2(t1,t2); typedef t3 TF3
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS_4(t1,t2,t3,t4) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS_3(t1,t2,t3); typedef t4 TF4
|
||||||
|
|
||||||
// This macro expands N-items tuple of fixed arguments types into part of
|
// This macro expands N-items tuple of fixed arguments types into part of
|
||||||
// function's declaration. For example,
|
// function's declaration. For example,
|
||||||
// "_WX_VARARG_FIXED_EXPAND(3, (int, char*, int))" expands into
|
// "_WX_VARARG_FIXED_EXPAND(3, (int, char*, int))" expands into
|
||||||
@@ -730,6 +750,14 @@ private:
|
|||||||
#define _WX_VARARG_FIXED_UNUSED_EXPAND_IMPL(N, args) \
|
#define _WX_VARARG_FIXED_UNUSED_EXPAND_IMPL(N, args) \
|
||||||
_WX_VARARG_FIXED_UNUSED_EXPAND_##N args
|
_WX_VARARG_FIXED_UNUSED_EXPAND_##N args
|
||||||
|
|
||||||
|
// Declarates typedefs for fixed arguments types; i-th fixed argument types
|
||||||
|
// will have TFi typedef.
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS(N, args) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS_IMPL(N, args)
|
||||||
|
#define _WX_VARARG_FIXED_TYPEDEFS_IMPL(N, args) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS_##N args
|
||||||
|
|
||||||
|
|
||||||
// This macro calls another macro 'm' passed as second argument 'N' times,
|
// This macro calls another macro 'm' passed as second argument 'N' times,
|
||||||
// with its only argument set to 1..N, and concatenates the results using
|
// with its only argument set to 1..N, and concatenates the results using
|
||||||
// comma as separator.
|
// comma as separator.
|
||||||
@@ -784,9 +812,11 @@ private:
|
|||||||
// And the same for fixed arguments, _not_ normalizing it:
|
// And the same for fixed arguments, _not_ normalizing it:
|
||||||
#define _WX_VARARG_PASS_FIXED(i) f##i
|
#define _WX_VARARG_PASS_FIXED(i) f##i
|
||||||
|
|
||||||
#define _WX_VARARG_FIND_FMT(i) (wxFindFormatStringArgument(f##i))
|
#define _WX_VARARG_FIND_FMT(i) \
|
||||||
|
(wxFormatStringArgumentFinder<TF##i>::find(f##i))
|
||||||
|
|
||||||
#define _WX_VARARG_FORMAT_STRING(numfixed, fixed) \
|
#define _WX_VARARG_FORMAT_STRING(numfixed, fixed) \
|
||||||
|
_WX_VARARG_FIXED_TYPEDEFS(numfixed, fixed); \
|
||||||
const wxFormatString *fmt = \
|
const wxFormatString *fmt = \
|
||||||
(_WX_VARARG_JOIN(numfixed, _WX_VARARG_FIND_FMT))
|
(_WX_VARARG_JOIN(numfixed, _WX_VARARG_FIND_FMT))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user