summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-08-14 21:13:52 -0600
committerKarl Williamson <public@khwilliamson.com>2013-09-24 11:36:15 -0600
commit09b2b2e6f2b6aae46dfa46b10931186a9531a1e0 (patch)
tree7b5c3eac1de1d0715a101e5590c3e83c161dab91 /perl.h
parentd1d040e539a86226d1a68f741e36ac5b3cfdbda9 (diff)
downloadperl-09b2b2e6f2b6aae46dfa46b10931186a9531a1e0.tar.gz
Make typedef fully typedef
The regcomp.c struct RExC_state_t has not been usable fully as a typedef, requiring the 'struct' at times. This has caused me, and I presume others, wasted time when we forget to use it under those circumstances when it should be used, but it's never been a big enough issue to cause me to spend tuits on it. But, working on something else, I finally came to the realization of what the problem is. It is because proto.h is #included before regcomp.h is, and so functions that are declared in proto.h that have something that is a RExC_state_t as a parameter don't know that it is a typedef because that is defined in regcomp.h. A way around this is already used for other similar structures, and that is to declare them in perl.h which is always read in before proto.h, leaving the definitions to regcomp.h. Thus proto.h knows enough to compile. The structure was already declared in perl.h; just not typedef'd. Otherwise proto.h would not know about it at all. This patch moves two regcomp.c related declarations in perl.h to the same section as the others, and changes the one for RExC_state_t to be a typedef. All the 'struct' uses are removed.
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/perl.h b/perl.h
index dfd425cbf0..bb196e6806 100644
--- a/perl.h
+++ b/perl.h
@@ -2212,9 +2212,6 @@ int isnan(double d);
#endif
-struct RExC_state_t;
-struct _reg_trie_data;
-
typedef MEM_SIZE STRLEN;
#ifdef PERL_MAD
@@ -3283,6 +3280,8 @@ struct regnode_charclass_class; /* Used in S_* functions in regcomp.c */
typedef struct regnode_charclass_class regnode_charclass_posixl;
typedef struct regnode_ssc regnode_ssc;
+typedef struct RExC_state_t RExC_state_t;
+struct _reg_trie_data;
struct ptr_tbl_ent {
struct ptr_tbl_ent* next;