X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da0ee16ef9fb566f81f3c1aef9928a3b01394338..c50db84779471824160c5701a72ad4db9b35c2f2:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index 9f5627263c..a96a6e91f4 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -474,7 +474,7 @@ typedef short int WXTYPE; #define wxSTDCALL #endif /* platform */ -/* LINKAGEMODE mode is empty for everyting except OS/2 */ +/* LINKAGEMODE mode is empty for everything except OS/2 */ #ifndef LINKAGEMODE #define LINKAGEMODE #endif /* LINKAGEMODE */ @@ -673,9 +673,13 @@ typedef short int WXTYPE; m(==,x,y,z) m(!=,x,y,z) m(>=,x,y,z) m(<=,x,y,z) m(>,x,y,z) m(<,x,y,z) /* - This is only used with wxDEFINE_COMPARISON_REV: it passes both the normal - and the reversed comparison operators to the macro. + These are only used with wxDEFINE_COMPARISON_[BY_]REV: they pass both the + normal and the reversed comparison operators to the macro. */ +#define wxFOR_ALL_COMPARISONS_2_REV(m, x, y) \ + m(==,x,y,==) m(!=,x,y,!=) m(>=,x,y,<=) \ + m(<=,x,y,>=) m(>,x,y,<) m(<,x,y,>) + #define wxFOR_ALL_COMPARISONS_3_REV(m, x, y, z) \ m(==,x,y,z,==) m(!=,x,y,z,!=) m(>=,x,y,z,<=) \ m(<=,x,y,z,>=) m(>,x,y,z,<) m(<,x,y,z,>) @@ -687,6 +691,9 @@ typedef short int WXTYPE; #define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp, oprev) \ inline bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); } +#define wxDEFINE_COMPARISON_BY_REV(op, T1, T2, oprev) \ + inline bool operator op(T1 x, T2 y) { return y oprev x; } + /* Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given types in the specified order. The implementation is provided by the cmp @@ -696,6 +703,14 @@ typedef short int WXTYPE; #define wxDEFINE_COMPARISONS(T1, T2, cmp) \ wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) +/* + Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given + types in the specified order, implemented in terms of existing operators + for the reverse order. + */ +#define wxDEFINE_COMPARISONS_BY_REV(T1, T2) \ + wxFOR_ALL_COMPARISONS_2_REV(wxDEFINE_COMPARISON_BY_REV, T1, T2) + /* This macro allows to define all 12 comparison operators (6 operators for both orders of arguments) for the given types using the provided "cmp" @@ -2775,7 +2790,7 @@ typedef int (* LINKAGEMODE wxListIterateFunction)(void *current); /* --------------------------------------------------------------------------- */ /* macros that enable wxWidgets apps to be compiled in absence of the */ -/* sytem headers, although some platform specific types are used in the */ +/* system headers, although some platform specific types are used in the */ /* platform specific (implementation) parts of the headers */ /* --------------------------------------------------------------------------- */