ptr_table_find() is only defined with ithreads
Rafael Garcia-Suarez [Mon, 27 Feb 2006 13:40:44 +0000 (13:40 +0000)]
p4raw-id: //depot/perl@27339

embed.fnc
embed.h
proto.h
sv.c

index f263361..91e7ad0 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1352,7 +1352,9 @@ s |void * |more_bodies    |svtype sv_type
 s      |bool   |sv_2iuv_common |NN SV *sv
 s      |void   |glob_assign_glob|NN SV *dstr|NN SV *sstr|const int dtype
 s      |void   |glob_assign_ref|NN SV *dstr|NN SV *sstr
+#  if defined(USE_ITHREADS)
 sRn    |PTR_TBL_ENT_t *|ptr_table_find|NN PTR_TBL_t *tbl|NN const void *sv
+#  endif
 s      |SV *   |find_hash_subscript|NULLOK HV *hv|NN SV *val
 s      |I32    |find_array_subscript|NULLOK AV *av|NN SV *val
 s      |SV *   |find_uninit_var|NULLOK OP *obase|NULLOK SV *uninit_sv|bool match
diff --git a/embed.h b/embed.h
index 66f5065..b1777d5 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define sv_2iuv_common         S_sv_2iuv_common
 #define glob_assign_glob       S_glob_assign_glob
 #define glob_assign_ref                S_glob_assign_ref
+#endif
+#  if defined(USE_ITHREADS)
+#ifdef PERL_CORE
 #define ptr_table_find         S_ptr_table_find
+#endif
+#  endif
+#ifdef PERL_CORE
 #define find_hash_subscript    S_find_hash_subscript
 #define find_array_subscript   S_find_array_subscript
 #define find_uninit_var                S_find_uninit_var
 #define sv_2iuv_common(a)      S_sv_2iuv_common(aTHX_ a)
 #define glob_assign_glob(a,b,c)        S_glob_assign_glob(aTHX_ a,b,c)
 #define glob_assign_ref(a,b)   S_glob_assign_ref(aTHX_ a,b)
+#endif
+#  if defined(USE_ITHREADS)
+#ifdef PERL_CORE
 #define ptr_table_find         S_ptr_table_find
+#endif
+#  endif
+#ifdef PERL_CORE
 #define find_hash_subscript(a,b)       S_find_hash_subscript(aTHX_ a,b)
 #define find_array_subscript(a,b)      S_find_array_subscript(aTHX_ a,b)
 #define find_uninit_var(a,b,c) S_find_uninit_var(aTHX_ a,b,c)
diff --git a/proto.h b/proto.h
index 4199bd9..9e33e43 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3735,11 +3735,13 @@ STATIC void     S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+#  if defined(USE_ITHREADS)
 STATIC PTR_TBL_ENT_t * S_ptr_table_find(PTR_TBL_t *tbl, const void *sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(2);
 
+#  endif
 STATIC SV *    S_find_hash_subscript(pTHX_ HV *hv, SV *val)
                        __attribute__nonnull__(pTHX_2);
 
diff --git a/sv.c b/sv.c
index e698ddf..5fc24dc 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -9524,7 +9524,7 @@ Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, const void *sv)
 void
 Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, const void *oldsv, void *newsv)
 {
-    PTR_TBL_ENT_t *tblent = S_ptr_table_find(tbl, oldsv);
+    PTR_TBL_ENT_t *tblent = ptr_table_find(tbl, oldsv);
     PERL_UNUSED_CONTEXT;
 
     if (tblent) {