cogl: avoid ‘_cogl_xyz_handle_new’ defined but not used warnings
authorRobert Bragg <robert@linux.intel.com>
Tue, 1 Jun 2010 10:50:02 +0000 (11:50 +0100)
committerRobert Bragg <robert@linux.intel.com>
Tue, 1 Jun 2010 11:20:58 +0000 (12:20 +0100)
This patch makes it so that only the backwards compatibility
COGL_HANDLE_DEFINE macro defines a _cogl_xyz_handle_new function. The
new COGL_OBJECT_DEFINE macro only defines a _cogl_xyz_object_new
function.

clutter/cogl/cogl/cogl-object.h

index bfa660b..2ef1553 100644 (file)
@@ -123,13 +123,7 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj)   \
   return new_obj;                                              \
 }                                                              \
                                                                \
-static Cogl##TypeName *                                                \
-_cogl_##type_name##_handle_new (CoglHandle handle)             \
-{                                                               \
-  return _cogl_##type_name##_object_new (handle);               \
-}                                                               \
-                                                               \
-Cogl##TypeName *                                               \
+Cogl##TypeName *                                                \
 _cogl_##type_name##_pointer_from_handle (CoglHandle handle)    \
 {                                                              \
   return handle;                                               \
@@ -177,7 +171,15 @@ cogl_##type_name##_unref (void *object)                            \
 }
 
 /* For temporary compatability */
-#define COGL_HANDLE_DEFINE COGL_OBJECT_DEFINE
+#define COGL_HANDLE_DEFINE(TypeName, type_name)                 \
+                                                               \
+COGL_OBJECT_DEFINE (TypeName, type_name)                        \
+                                                               \
+static Cogl##TypeName *                                                \
+_cogl_##type_name##_handle_new (CoglHandle handle)             \
+{                                                               \
+  return _cogl_##type_name##_object_new (handle);               \
+}
 
 #endif /* __COGL_OBJECT_H */