[beast: 128/144] SFI: fix flags enum combination operators to be consexpr for g++-4.7 C++11
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 128/144] SFI: fix flags enum combination operators to be consexpr for g++-4.7 C++11
- Date: Sat, 19 Jan 2013 00:55:05 +0000 (UTC)
commit b2afd7adc7129698b8ad8d5305df8b6bbe4c5dd5
Author: Tim Janik <timj gnu org>
Date: Sun Jan 13 19:16:25 2013 +0100
SFI: fix flags enum combination operators to be consexpr for g++-4.7 C++11
sfi/glib-extra.hh | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index aa3ed37..5dc33dd 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -269,25 +269,25 @@ GScanner* g_scanner_new64 (const GScannerConfig *config_templ);
G_END_DECLS
// == Flags Enumeration Operators in C++ ==
#ifdef __cplusplus
-inline GParamFlags operator& (GParamFlags s1, GParamFlags s2) { return GParamFlags (s1 & (long long unsigned) s2); }
-inline GParamFlags& operator&= (GParamFlags &s1, GParamFlags s2) { s1 = s1 & s2; return s1; }
-inline GParamFlags operator| (GParamFlags s1, GParamFlags s2) { return GParamFlags (s1 | (long long unsigned) s2); }
-inline GParamFlags& operator|= (GParamFlags &s1, GParamFlags s2) { s1 = s1 | s2; return s1; }
-inline GParamFlags operator~ (GParamFlags s1) { return GParamFlags (~(long long unsigned) s1); }
-inline GSignalMatchType operator& (GSignalMatchType s1, GSignalMatchType s2) { return GSignalMatchType (s1 & (long long unsigned) s2); }
-inline GSignalMatchType& operator&= (GSignalMatchType &s1, GSignalMatchType s2) { s1 = s1 & s2; return s1; }
-inline GSignalMatchType operator| (GSignalMatchType s1, GSignalMatchType s2) { return GSignalMatchType (s1 | (long long unsigned) s2); }
-inline GSignalMatchType& operator|= (GSignalMatchType &s1, GSignalMatchType s2) { s1 = s1 | s2; return s1; }
-inline GSignalMatchType operator~ (GSignalMatchType s1) { return GSignalMatchType (~(long long unsigned) s1); }
-inline GSignalFlags operator& (GSignalFlags s1, GSignalFlags s2) { return GSignalFlags (s1 & (long long unsigned) s2); }
-inline GSignalFlags& operator&= (GSignalFlags &s1, GSignalFlags s2) { s1 = s1 & s2; return s1; }
-inline GSignalFlags operator| (GSignalFlags s1, GSignalFlags s2) { return GSignalFlags (s1 | (long long unsigned) s2); }
-inline GSignalFlags& operator|= (GSignalFlags &s1, GSignalFlags s2) { s1 = s1 | s2; return s1; }
-inline GSignalFlags operator~ (GSignalFlags s1) { return GSignalFlags (~(long long unsigned) s1); }
-inline GConnectFlags operator& (GConnectFlags s1, GConnectFlags s2) { return GConnectFlags (s1 & (long long unsigned) s2); }
-inline GConnectFlags& operator&= (GConnectFlags &s1, GConnectFlags s2) { s1 = s1 & s2; return s1; }
-inline GConnectFlags operator| (GConnectFlags s1, GConnectFlags s2) { return GConnectFlags (s1 | (long long unsigned) s2); }
-inline GConnectFlags& operator|= (GConnectFlags &s1, GConnectFlags s2) { s1 = s1 | s2; return s1; }
-inline GConnectFlags operator~ (GConnectFlags s1) { return GConnectFlags (~(long long unsigned) s1); }
+constexpr GParamFlags operator& (GParamFlags s1, GParamFlags s2) { return GParamFlags (s1 & (long long unsigned) s2); }
+inline GParamFlags& operator&= (GParamFlags &s1, GParamFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GParamFlags operator| (GParamFlags s1, GParamFlags s2) { return GParamFlags (s1 | (long long unsigned) s2); }
+inline GParamFlags& operator|= (GParamFlags &s1, GParamFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GParamFlags operator~ (GParamFlags s1) { return GParamFlags (~(long long unsigned) s1); }
+constexpr GSignalMatchType operator& (GSignalMatchType s1, GSignalMatchType s2) { return GSignalMatchType (s1 & (long long unsigned) s2); }
+inline GSignalMatchType& operator&= (GSignalMatchType &s1, GSignalMatchType s2) { s1 = s1 & s2; return s1; }
+constexpr GSignalMatchType operator| (GSignalMatchType s1, GSignalMatchType s2) { return GSignalMatchType (s1 | (long long unsigned) s2); }
+inline GSignalMatchType& operator|= (GSignalMatchType &s1, GSignalMatchType s2) { s1 = s1 | s2; return s1; }
+constexpr GSignalMatchType operator~ (GSignalMatchType s1) { return GSignalMatchType (~(long long unsigned) s1); }
+constexpr GSignalFlags operator& (GSignalFlags s1, GSignalFlags s2) { return GSignalFlags (s1 & (long long unsigned) s2); }
+inline GSignalFlags& operator&= (GSignalFlags &s1, GSignalFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GSignalFlags operator| (GSignalFlags s1, GSignalFlags s2) { return GSignalFlags (s1 | (long long unsigned) s2); }
+inline GSignalFlags& operator|= (GSignalFlags &s1, GSignalFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GSignalFlags operator~ (GSignalFlags s1) { return GSignalFlags (~(long long unsigned) s1); }
+constexpr GConnectFlags operator& (GConnectFlags s1, GConnectFlags s2) { return GConnectFlags (s1 & (long long unsigned) s2); }
+inline GConnectFlags& operator&= (GConnectFlags &s1, GConnectFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GConnectFlags operator| (GConnectFlags s1, GConnectFlags s2) { return GConnectFlags (s1 | (long long unsigned) s2); }
+inline GConnectFlags& operator|= (GConnectFlags &s1, GConnectFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GConnectFlags operator~ (GConnectFlags s1) { return GConnectFlags (~(long long unsigned) s1); }
#endif // __cplusplus
#endif /* __SFI_GLIB_EXTRA_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]