diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-04 23:23:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-04 23:23:45 +0000 |
commit | 15855fa84a09fd1fd486d357c38db0f2bd181e74 (patch) | |
tree | c98d1ae74abca41c776522059343eda13a7e0a31 /plugins/HistoryStats/src/_langext.h | |
parent | 819f8efabea6b0d7d971f9e6e4b21bbc18838874 (diff) |
HistoryStats compiles ok now
git-svn-id: http://svn.miranda-ng.org/main/trunk@8399 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryStats/src/_langext.h')
-rw-r--r-- | plugins/HistoryStats/src/_langext.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/HistoryStats/src/_langext.h b/plugins/HistoryStats/src/_langext.h new file mode 100644 index 0000000000..ffe1626643 --- /dev/null +++ b/plugins/HistoryStats/src/_langext.h @@ -0,0 +1,35 @@ +#if !defined(HISTORYSTATS_GUARD__LANGEXT_H)
+#define HISTORYSTATS_GUARD__LANGEXT_H
+
+/*
+ * language "enhancements" - people will hate me for this
+ */
+
+#define bool_(c_bool) \
+ ((c_bool) ? true : false)
+
+#define BOOL_(cpp_bool) \
+ ((cpp_bool) ? TRUE : FALSE)
+
+#define array_len(array_var) \
+ (sizeof(array_var) / sizeof((array_var)[0]))
+
+#define range_each_(index_var, lo_bound, up_bound) \
+ for (int index_var = (lo_bound); index_var < (up_bound); ++index_var)
+
+#define upto_each_(index_var, up_bound) \
+ range_each_(index_var, 0, (up_bound))
+
+#define array_each_(index_var, array_var) \
+ range_each_(index_var, 0, array_len(array_var))
+
+#define vector_each_(index_var, vector_var) \
+ for (int index_var = 0; index_var != (vector_var).size(); ++index_var)
+
+#define iter_each_(cont_type, iter_var, cont_var) \
+ for (cont_type::iterator iter_var = (cont_var).begin(); iter_var != (cont_var).end(); ++iter_var)
+
+#define citer_each_(cont_type, iter_var, cont_var) \
+ for (cont_type::const_iterator iter_var = (cont_var).begin(); iter_var != (cont_var).end(); ++iter_var)
+
+#endif // HISTORYSTATS_GUARD__LANGEXT_H
|