Merge branch 'stable'
[gitmo/Class-MOP.git] / mop.h
diff --git a/mop.h b/mop.h
index e3b5b91..5547745 100644 (file)
--- a/mop.h
+++ b/mop.h
 #define NEED_sv_2pv_nolen
 #include "ppport.h"
 
-#define MOP_CALL_BOOT(name) \
-    { \
-        EXTERN_C XS(name); \
-        mop_call_xs(aTHX_ name, cv, mark); \
-    }
+#define MOP_CALL_BOOT(name)  mop_call_xs(aTHX_ name, cv, mark);
+
+#ifndef XSPROTO
+#define XSPROTO(name) XS(name)
+#endif
 
-void mop_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *), CV *cv, SV **mark);
+void mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark);
 
 typedef enum {
+    KEY__expected_method_class,
+    KEY_ISA,
+    KEY_VERSION,
+    KEY_accessor,
+    KEY_associated_class,
+    KEY_associated_metaclass,
+    KEY_associated_methods,
+    KEY_attribute_metaclass,
+    KEY_attributes,
+    KEY_body,
+    KEY_builder,
+    KEY_clearer,
+    KEY_constructor_class,
+    KEY_constructor_name,
+    KEY_definition_context,
+    KEY_destructor_class,
+    KEY_immutable_trait,
+    KEY_init_arg,
+    KEY_initializer,
+    KEY_insertion_order,
+    KEY_instance_metaclass,
+    KEY_is_inline,
+    KEY_method_metaclass,
+    KEY_methods,
     KEY_name,
     KEY_package,
     KEY_package_name,
-    KEY_body,
+    KEY_predicate,
+    KEY_reader,
+    KEY_wrapped_method_metaclass,
+    KEY_writer,
     KEY_package_cache_flag,
-    KEY_methods,
-    KEY_VERSION,
-    KEY_ISA,
+    KEY__version,
     key_last,
 } mop_prehashed_key_t;
 
@@ -34,15 +59,10 @@ typedef enum {
 #define HASH_FOR(name) mop_prehashed_hash_for(KEY_ ##name)
 
 void mop_prehash_keys (void);
-inline SV *mop_prehashed_key_for (mop_prehashed_key_t key);
-inline U32 mop_prehashed_hash_for (mop_prehashed_key_t key);
-
-#define INSTALL_SIMPLE_READER(klass, name) \
-    { \
-        CV *cv = newXS("Class::MOP::" #klass "::" #name, mop_xs_simple_reader, __FILE__); \
-        CvXSUBANY(cv).any_i32 = KEY_ ##name; \
-    }
+SV *mop_prehashed_key_for (mop_prehashed_key_t key);
+U32 mop_prehashed_hash_for (mop_prehashed_key_t key);
 
+#define INSTALL_SIMPLE_READER(klass, name)  INSTALL_SIMPLE_READER_WITH_KEY(klass, name, name)
 #define INSTALL_SIMPLE_READER_WITH_KEY(klass, name, key) \
     { \
         CV *cv = newXS("Class::MOP::" #klass "::" #name, mop_xs_simple_reader, __FILE__); \