From 9551dd1cd357138c4972800091e083055208d383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 15 Jan 2005 02:38:52 +0000 Subject: [PATCH] Added rgb_color == and != operators - inline only. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10742 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/GraphicsDefs.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/headers/os/interface/GraphicsDefs.h b/headers/os/interface/GraphicsDefs.h index a09db9171b..30d1fc619d 100644 --- a/headers/os/interface/GraphicsDefs.h +++ b/headers/os/interface/GraphicsDefs.h @@ -60,6 +60,22 @@ typedef struct rgb_color { uint8 green; uint8 blue; uint8 alpha; + +#if defined(__cplusplus) + // some convenient additions + + inline bool + operator==(const rgb_color& other) const + { + return *(const uint32 *)this == *(const uint32 *)&other; + } + + inline bool + operator!=(const rgb_color& other) const + { + return *(const uint32 *)this != *(const uint32 *)&other; + } +#endif } rgb_color; //------------------------------------------------------------------------------