xref: /netbsd-src/external/gpl3/gcc.old/dist/libphobos/libdruntime/rt/obj.d (revision 627f7eb200a4419d89b531d55fccd2ee3ffdcde0)
1 /**
2  * Contains object comparator functions called by generated code.
3  *
4  * Copyright: Copyright Digital Mars 2002 - 2010.
5  * License:   $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6  * Authors:   Walter Bright
7  */
8 
9 /*          Copyright Digital Mars 2000 - 2010.
10  * Distributed under the Boost Software License, Version 1.0.
11  *    (See accompanying file LICENSE or copy at
12  *          http://www.boost.org/LICENSE_1_0.txt)
13  */
14 module rt.obj;
15 
16 extern (C):
17 
18 /********************************
19  * Compiler helper for operator == for class objects.
20  */
21 
_d_obj_eq(Object o1,Object o2)22 int _d_obj_eq(Object o1, Object o2)
23 {
24     return o1 is o2 || (o1 && o1.opEquals(o2));
25 }
26 
27 
28 /********************************
29  * Compiler helper for operator <, <=, >, >= for class objects.
30  */
31 
_d_obj_cmp(Object o1,Object o2)32 int _d_obj_cmp(Object o1, Object o2)
33 {
34     return o1.opCmp(o2);
35 }
36