This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make typedef fully typedef
authorKarl Williamson <public@khwilliamson.com>
Thu, 15 Aug 2013 03:13:52 +0000 (21:13 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 24 Sep 2013 17:36:15 +0000 (11:36 -0600)
commit09b2b2e6f2b6aae46dfa46b10931186a9531a1e0
tree7b5c3eac1de1d0715a101e5590c3e83c161dab91
parentd1d040e539a86226d1a68f741e36ac5b3cfdbda9
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.
embed.fnc
embed.h
perl.h
proto.h
regcomp.c