Skip to content

Commit 0f6279c

Browse files
committed
Make sure mathoms gets loaded
1 parent 5df7a2e commit 0f6279c

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

embed.fnc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,7 @@ ERXp |HV * |load_charnames |NN SV *char_name \
18071807
|NN const char *context \
18081808
|const STRLEN context_len \
18091809
|NN const char **error_msg
1810+
MTbp |void |load_mathoms
18101811
AFdpv |void |load_module |U32 flags \
18111812
|NN SV *name \
18121813
|NULLOK SV *ver \

embedvar.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

intrpvar.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,18 @@ PERLVAR(I, prevailing_version, U16)
11011101
PERLVARI(I, in_diehook, bool, FALSE)
11021102
PERLVARI(I, in_warnhook, bool, FALSE)
11031103

1104+
/* Perl_load_mathoms is defined in mathoms.c, so this forces the loading of the
1105+
* functions in that file when NO_MATHOMS isn't defined. Otherwise, it is just
1106+
* a pointer to a function that is always going to exist. The use of
1107+
* Perl_noshutdownhook is solely because there is a typedef for its signature
1108+
* and has no arguments that need to be passed */
1109+
#ifdef NO_MATHOMS
1110+
# define PERL_LOAD_MATHOMS_HOOK Perl_noshutdownhook
1111+
#else
1112+
# define PERL_LOAD_MATHOMS_HOOK Perl_load_mathoms
1113+
#endif
1114+
PERLVARI(I, load_mathoms, shutdown_proc_t, PERL_LOAD_MATHOMS_HOOK)
1115+
11041116
/* If you are adding a U8 or U16, check to see if there are 'Space' comments
11051117
* above on where there are gaps which currently will be structure padding. */
11061118

mathoms.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
* without a compiler warning */
7474
GCC_DIAG_IGNORE(-Wdeprecated-declarations)
7575

76+
void
77+
Perl_load_mathoms()
78+
{
79+
/* This exists only to make sure the functions in this file get loaded, as
80+
* it is referred to by a structure element in intrpvar.h */
81+
}
82+
7683
/* ref() is now a macro using Perl_doref;
7784
* this version provided for binary compatibility only.
7885
*/

proto.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)