1 dnl $Id: compare.m4 58 2003-12-14 11:53:04Z murrayc $
3 define(`__OPERATOR_DECL',`dnl
4 /** @relates __NAMESPACE__::__CPPNAME__
5 * @param lhs The left-hand side
6 * @param rhs The right-hand side
9 bool operator`'$1`'(const __CPPNAME__& lhs, const __CPPNAME__& rhs);
12 define(`__OPERATOR_IMPL',`dnl
13 bool operator`'$1`'(const __CPPNAME__& lhs, const __CPPNAME__& rhs)
15 ifelse`'(`__UNCONST__',`unconst',`dnl
16 return ($2`'(const_cast<__CNAME__*>(lhs.gobj()), const_cast<__CNAME__*>(rhs.gobj())) $3);
18 return ($2`'(lhs.gobj(), rhs.gobj()) $3);
25 dnl _WRAP_EQUAL(gdk_region_equal, unconst)
27 define(`_WRAP_EQUAL',`dnl
28 pushdef(`__FUNC_EQUAL__',$1)dnl
29 pushdef(`__UNCONST__',$2)dnl
30 _PUSH(SECTION_HEADER3)
41 __OPERATOR_IMPL(`==', __FUNC_EQUAL__, `!= 0')
42 __OPERATOR_IMPL(`!=', __FUNC_EQUAL__, `== 0')
45 popdef(`__UNCONST__')dnl
46 popdef(`__FUNC_EQUAL__')dnl
47 ')dnl enddef _WRAP_EQUAL
51 dnl _WRAP_COMPARE(gtk_tree_path_compare)
53 define(`_WRAP_COMPARE',`dnl
54 pushdef(`__FUNC_COMPARE__',$1)dnl
55 pushdef(`__UNCONST__',$2)dnl
56 _PUSH(SECTION_HEADER3)
71 __OPERATOR_IMPL(`==', __FUNC_COMPARE__, `== 0')
72 __OPERATOR_IMPL(`!=', __FUNC_COMPARE__, `!= 0')
73 __OPERATOR_IMPL(`<', __FUNC_COMPARE__, `< 0')
74 __OPERATOR_IMPL(`>', __FUNC_COMPARE__, `> 0')
75 __OPERATOR_IMPL(`<=', __FUNC_COMPARE__, `<= 0')
76 __OPERATOR_IMPL(`>=', __FUNC_COMPARE__, `>= 0')
79 popdef(`__UNCONST__')dnl
80 popdef(`__FUNC_COMPARE__')dnl
81 ')dnl enddef _WRAP_COMPARE
85 dnl _WRAP_EQUAL_AND_COMPARE(gtk_text_iter_equal, gtk_text_iter_compare)
87 define(`_WRAP_EQUAL_AND_COMPARE',`dnl
88 pushdef(`__FUNC_EQUAL__',$1)dnl
89 pushdef(`__FUNC_COMPARE__',$2)dnl
90 pushdef(`__UNCONST__',$3)dnl
91 _PUSH(SECTION_HEADER3)
100 __OPERATOR_DECL(`>=')
106 __OPERATOR_IMPL(`==', __FUNC_EQUAL__, `!= 0')
107 __OPERATOR_IMPL(`!=', __FUNC_EQUAL__, `== 0')
108 __OPERATOR_IMPL(`<', __FUNC_COMPARE__, `< 0')
109 __OPERATOR_IMPL(`>', __FUNC_COMPARE__, `> 0')
110 __OPERATOR_IMPL(`<=', __FUNC_COMPARE__, `<= 0')
111 __OPERATOR_IMPL(`>=', __FUNC_COMPARE__, `>= 0')
114 popdef(`__UNCONST__')dnl
115 popdef(`__FUNC_COMPARE__')dnl
116 popdef(`__FUNC_EQUAL__')dnl
117 ')dnl enddef _WRAP_EQUAL_AND_COMPARE