mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
A working configure&makefile; now in the process of getting it to build on gcc
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@182 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+2
-2
@@ -12,6 +12,6 @@
|
||||
|
||||
// what a waste of a source file...
|
||||
|
||||
volatile LONG Age::new_age;
|
||||
AtomicInt Age::new_age(0);
|
||||
|
||||
IMPLEMENT_DYNAMIC_ARG(long, last_update_age, 0);
|
||||
IMPLEMENT_DYNAMIC_ARG(AtomicIntEquiv, last_update_age, 0);
|
||||
|
||||
+6
-2
@@ -64,6 +64,10 @@
|
||||
class AtomicInt {
|
||||
public:
|
||||
AtomicInt(AtomicIntEquiv v) : v(v) {}
|
||||
AtomicInt(const AtomicInt& i) {
|
||||
wxCriticalSectionLocker lock(i.cs);
|
||||
v = i.v;
|
||||
}
|
||||
inline operator AtomicIntEquiv() const {
|
||||
return v;
|
||||
}
|
||||
@@ -78,8 +82,8 @@
|
||||
return --v;
|
||||
}
|
||||
private:
|
||||
AtomicIntEquiv v; ///< The value
|
||||
wxCriticalSection cs; ///< Critical section protecting v
|
||||
AtomicIntEquiv v; ///< The value
|
||||
mutable wxCriticalSection cs; ///< Critical section protecting v
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,10 +58,10 @@ class Defaultable {
|
||||
inline bool operator != (const Defaultable& that) const { return value != that.value; }
|
||||
|
||||
private:
|
||||
/// Is this value in the default state?
|
||||
bool is_default;
|
||||
/// The value
|
||||
T value;
|
||||
/// Is this value in the default state?
|
||||
bool is_default;
|
||||
|
||||
friend class Reader;
|
||||
friend class Writer;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TYPEOF_RIT(Value) __typeof(Value.rbegin())
|
||||
#define TYPEOF_CRIT(Value) __typeof(Value.rbegin())
|
||||
#define TYPEOF_REF(Value) __typeof(*Value.begin())&
|
||||
#define TYPEOF_CREF(Value) __typeof(*Value.begin())&
|
||||
|
||||
#else
|
||||
/// Helper for typeof tricks
|
||||
|
||||
+21
-5
@@ -57,17 +57,33 @@ String tr(LocaleCategory cat, const String& key);
|
||||
#define _ERROR_(s) tr(LOCALE_CAT_ERROR, _(s))
|
||||
|
||||
/// A localized string for menus/toolbar buttons, with 1 argument (printf style)
|
||||
#define _MENU_1_(s,a) String::Format(tr(LOCALE_CAT_MENU, _(s)), a)
|
||||
#define _MENU_1_(s,a) format_string(tr(LOCALE_CAT_MENU, _(s)), a)
|
||||
|
||||
/// A localized string for tooltip text, with 1 argument (printf style)
|
||||
#define _TOOL_1_(s,a) String::Format(tr(LOCALE_CAT_TOOL, _(s)), a)
|
||||
#define _TOOL_1_(s,a) format_string(tr(LOCALE_CAT_TOOL, _(s)), a)
|
||||
|
||||
/// A localized string for error messages, with 1 argument (printf style)
|
||||
#define _ERROR_1_(s,a) String::Format(tr(LOCALE_CAT_ERROR, _(s)), a)
|
||||
#define _ERROR_1_(s,a) format_string(tr(LOCALE_CAT_ERROR, _(s)), a)
|
||||
/// A localized string for error messages, with 2 argument (printf style)
|
||||
#define _ERROR_2_(s,a,b) String::Format(tr(LOCALE_CAT_ERROR, _(s)), a, b)
|
||||
#define _ERROR_2_(s,a,b) format_string(tr(LOCALE_CAT_ERROR, _(s)), a, b)
|
||||
/// A localized string for error messages, with 3 argument (printf style)
|
||||
#define _ERROR_3_(s,a,b,c) String::Format(tr(LOCALE_CAT_ERROR, _(s)), a, b, c)
|
||||
#define _ERROR_3_(s,a,b,c) format_string(tr(LOCALE_CAT_ERROR, _(s)), a, b, c)
|
||||
|
||||
/// Format a string
|
||||
/** Equivalent to sprintf / String::Format, but allows strings to be passed as arguments (gcc)
|
||||
*/
|
||||
inline String format_string(const String& format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
return String::Format(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
inline String format_string(const String& format, const String& a0) {
|
||||
return format_string(format, a0.c_str());
|
||||
}
|
||||
inline String format_string(const String& format, const String& a0, const String& a1) {
|
||||
return format_string(format, a0.c_str(), a1.c_str());
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user