summaryrefslogtreecommitdiff
blob: 3de9b49f441e5f60b50a5ca91ff95e8775cf0286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- a/apc_serializer.h
+++ b/apc_serializer.h
@@ -32,29 +32,37 @@
 typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS);
 typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS);
 
-typedef int (*apc_register_serializer_t)(const char* name, 
-                                        apc_serialize_t serialize, 
+typedef int (*apc_register_serializer_t)(const char* name,
+                                        apc_serialize_t serialize,
                                         apc_unserialize_t unserialize,
                                         void *config TSRMLS_DC);
 
 /*
  * ABI version for constant hooks. Increment this any time you make any changes 
  * to any function in this file.
  */
 #define APC_SERIALIZER_ABI "0"
 #define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI
 
-static int apc_register_serializer(const char* name, 
+#if !defined(APC_UNUSED)
+# if defined(__GNUC__)
+#  define APC_UNUSED __attribute__((unused))
+# else
+# define APC_UNUSED
+# endif
+#endif
+
+static APC_UNUSED int apc_register_serializer(const char* name,
                                     apc_serialize_t serialize,
                                     apc_unserialize_t unserialize,
                                     void *config TSRMLS_DC)
 {
     zval *apc_magic_constant = NULL;
     (void)config;
     
     ALLOC_INIT_ZVAL(apc_magic_constant);
 
-    if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, apc_magic_constant)) { 
+    if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, apc_magic_constant TSRMLS_CC)) {
         if(apc_magic_constant) {
             apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL_P(apc_magic_constant));
             if(register_func) {