[beast: 129/144] GXK: fix flags enum combination operators to be consexpr for g++-4.7 C++11



commit be4c20b6184e4e8821f13e98550e2653409f5896
Author: Tim Janik <timj gnu org>
Date:   Sun Jan 13 19:40:37 2013 +0100

    GXK: fix flags enum combination operators to be consexpr for g++-4.7 C++11

 beast-gtk/gxk/gxkdialog.hh    |   20 ++++++++++----------
 beast-gtk/gxk/gxkglobals.hh   |   40 ++++++++++++++++++++--------------------
 beast-gtk/gxk/gxktexttools.hh |   10 +++++-----
 3 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/beast-gtk/gxk/gxkdialog.hh b/beast-gtk/gxk/gxkdialog.hh
index a5c2672..c8f31b2 100644
--- a/beast-gtk/gxk/gxkdialog.hh
+++ b/beast-gtk/gxk/gxkdialog.hh
@@ -101,15 +101,15 @@ GtkWidget*	gxk_dialog_action_multi		(GxkDialog	    *dialog,
 G_END_DECLS
 // == Flags Enumeration Operators in C++ ==
 #ifdef __cplusplus
-inline GxkDialogFlags  operator&  (GxkDialogFlags  s1, GxkDialogFlags s2) { return GxkDialogFlags (s1 & (long long unsigned) s2); }
-inline GxkDialogFlags& operator&= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 = s1 & s2; return s1; }
-inline GxkDialogFlags  operator|  (GxkDialogFlags  s1, GxkDialogFlags s2) { return GxkDialogFlags (s1 | (long long unsigned) s2); }
-inline GxkDialogFlags& operator|= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 = s1 | s2; return s1; }
-inline GxkDialogFlags  operator~  (GxkDialogFlags  s1)                    { return GxkDialogFlags (~(long long unsigned) s1); }
-inline GxkDialogMultiFlags  operator&  (GxkDialogMultiFlags  s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 & (long long unsigned) s2); }
-inline GxkDialogMultiFlags& operator&= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 & s2; return s1; }
-inline GxkDialogMultiFlags  operator|  (GxkDialogMultiFlags  s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 | (long long unsigned) s2); }
-inline GxkDialogMultiFlags& operator|= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 | s2; return s1; }
-inline GxkDialogMultiFlags  operator~  (GxkDialogMultiFlags  s1)                    { return GxkDialogMultiFlags (~(long long unsigned) s1); }
+constexpr GxkDialogFlags  operator&  (GxkDialogFlags  s1, GxkDialogFlags s2) { return GxkDialogFlags (s1 & (long long unsigned) s2); }
+inline    GxkDialogFlags& operator&= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GxkDialogFlags  operator|  (GxkDialogFlags  s1, GxkDialogFlags s2) { return GxkDialogFlags (s1 | (long long unsigned) s2); }
+inline    GxkDialogFlags& operator|= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GxkDialogFlags  operator~  (GxkDialogFlags  s1)                    { return GxkDialogFlags (~(long long unsigned) s1); }
+constexpr GxkDialogMultiFlags  operator&  (GxkDialogMultiFlags  s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 & (long long unsigned) s2); }
+inline    GxkDialogMultiFlags& operator&= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GxkDialogMultiFlags  operator|  (GxkDialogMultiFlags  s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 | (long long unsigned) s2); }
+inline    GxkDialogMultiFlags& operator|= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GxkDialogMultiFlags  operator~  (GxkDialogMultiFlags  s1)                    { return GxkDialogMultiFlags (~(long long unsigned) s1); }
 #endif // __cplusplus
 #endif  /* __GXK_DIALOG_H__ */
diff --git a/beast-gtk/gxk/gxkglobals.hh b/beast-gtk/gxk/gxkglobals.hh
index a891f00..0a09c2e 100644
--- a/beast-gtk/gxk/gxkglobals.hh
+++ b/beast-gtk/gxk/gxkglobals.hh
@@ -40,25 +40,25 @@ void	gxk_init_radget_types	(void);
 G_END_DECLS
 // == Flags Enumeration Operators in C++ ==
 #ifdef __cplusplus
-inline GdkEventMask  operator&  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 & (long long unsigned) s2); }
-inline GdkEventMask& operator&= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 & s2; return s1; }
-inline GdkEventMask  operator|  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 | (long long unsigned) s2); }
-inline GdkEventMask& operator|= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 | s2; return s1; }
-inline GdkEventMask  operator~  (GdkEventMask  s1)                 { return GdkEventMask (~(long long unsigned) s1); }
-inline GdkModifierType  operator&  (GdkModifierType  s1, GdkModifierType s2) { return GdkModifierType (s1 & (long long unsigned) s2); }
-inline GdkModifierType& operator&= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 & s2; return s1; }
-inline GdkModifierType  operator|  (GdkModifierType  s1, GdkModifierType s2) { return GdkModifierType (s1 | (long long unsigned) s2); }
-inline GdkModifierType& operator|= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 | s2; return s1; }
-inline GdkModifierType  operator~  (GdkModifierType  s1)                 { return GdkModifierType (~(long long unsigned) s1); }
-inline GdkWindowHints  operator&  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 & (long long unsigned) s2); }
-inline GdkWindowHints& operator&= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 & s2; return s1; }
-inline GdkWindowHints  operator|  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 | (long long unsigned) s2); }
-inline GdkWindowHints& operator|= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 | s2; return s1; }
-inline GdkWindowHints  operator~  (GdkWindowHints  s1)                 { return GdkWindowHints (~(long long unsigned) s1); }
-inline GtkAttachOptions  operator&  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 & (long long unsigned) s2); }
-inline GtkAttachOptions& operator&= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 & s2; return s1; }
-inline GtkAttachOptions  operator|  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 | (long long unsigned) s2); }
-inline GtkAttachOptions& operator|= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 | s2; return s1; }
-inline GtkAttachOptions  operator~  (GtkAttachOptions  s1)                 { return GtkAttachOptions (~(long long unsigned) s1); }
+constexpr GdkEventMask  operator&  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 & (long long unsigned) s2); }
+inline    GdkEventMask& operator&= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 & s2; return s1; }
+constexpr GdkEventMask  operator|  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 | (long long unsigned) s2); }
+inline    GdkEventMask& operator|= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 | s2; return s1; }
+constexpr GdkEventMask  operator~  (GdkEventMask  s1)                 { return GdkEventMask (~(long long unsigned) s1); }
+constexpr GdkModifierType  operator&  (GdkModifierType  s1, GdkModifierType s2) { return GdkModifierType (s1 & (long long unsigned) s2); }
+inline    GdkModifierType& operator&= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 & s2; return s1; }
+constexpr GdkModifierType  operator|  (GdkModifierType  s1, GdkModifierType s2) { return GdkModifierType (s1 | (long long unsigned) s2); }
+inline    GdkModifierType& operator|= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 | s2; return s1; }
+constexpr GdkModifierType  operator~  (GdkModifierType  s1)                 { return GdkModifierType (~(long long unsigned) s1); }
+constexpr GdkWindowHints  operator&  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 & (long long unsigned) s2); }
+inline    GdkWindowHints& operator&= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 & s2; return s1; }
+constexpr GdkWindowHints  operator|  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 | (long long unsigned) s2); }
+inline    GdkWindowHints& operator|= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 | s2; return s1; }
+constexpr GdkWindowHints  operator~  (GdkWindowHints  s1)                 { return GdkWindowHints (~(long long unsigned) s1); }
+constexpr GtkAttachOptions  operator&  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 & (long long unsigned) s2); }
+inline    GtkAttachOptions& operator&= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 & s2; return s1; }
+constexpr GtkAttachOptions  operator|  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 | (long long unsigned) s2); }
+inline    GtkAttachOptions& operator|= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 | s2; return s1; }
+constexpr GtkAttachOptions  operator~  (GtkAttachOptions  s1)                 { return GtkAttachOptions (~(long long unsigned) s1); }
 #endif // __cplusplus
 #endif /* __GXK_GLOBALS_H__ */
diff --git a/beast-gtk/gxk/gxktexttools.hh b/beast-gtk/gxk/gxktexttools.hh
index 4c7aa20..8da5633 100644
--- a/beast-gtk/gxk/gxktexttools.hh
+++ b/beast-gtk/gxk/gxktexttools.hh
@@ -83,10 +83,10 @@ void    gxk_text_buffer_add_textgets_to_view (GtkTextBuffer        *tbuffer,
 G_END_DECLS
 // == Flags Enumeration Operators in C++ ==
 #ifdef __cplusplus
-inline GxkScrollTextFlags  operator&  (GxkScrollTextFlags  s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 & (long long unsigned) s2); }
-inline GxkScrollTextFlags& operator&= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 & s2; return s1; }
-inline GxkScrollTextFlags  operator|  (GxkScrollTextFlags  s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 | (long long unsigned) s2); }
-inline GxkScrollTextFlags& operator|= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 | s2; return s1; }
-inline GxkScrollTextFlags  operator~  (GxkScrollTextFlags  s1)                 { return GxkScrollTextFlags (~(long long unsigned) s1); }
+constexpr GxkScrollTextFlags  operator&  (GxkScrollTextFlags  s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 & (long long unsigned) s2); }
+inline    GxkScrollTextFlags& operator&= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 & s2; return s1; }
+constexpr GxkScrollTextFlags  operator|  (GxkScrollTextFlags  s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 | (long long unsigned) s2); }
+inline    GxkScrollTextFlags& operator|= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 | s2; return s1; }
+constexpr GxkScrollTextFlags  operator~  (GxkScrollTextFlags  s1)                 { return GxkScrollTextFlags (~(long long unsigned) s1); }
 #endif // __cplusplus
 #endif /* __GXK_TEXT_TOOLS_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]