This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document IN_PERL_(RUN|COMPILE)TIME
authorKarl Williamson <khw@cpan.org>
Thu, 27 Aug 2020 15:09:46 +0000 (09:09 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 5 Sep 2020 16:15:53 +0000 (10:15 -0600)
cop.h

diff --git a/cop.h b/cop.h
index d7c42aa..49f1d0c 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -1111,11 +1111,20 @@ typedef struct stackinfo PERL_SI;
        }                                                               \
     } STMT_END
 
-#define IN_PERL_COMPILETIME    cBOOL(PL_curcop == &PL_compiling)
-#define IN_PERL_RUNTIME                cBOOL(PL_curcop != &PL_compiling)
-
+/*
+=for apidoc_section Utility Functions
+=for apidoc Amn|bool|IN_PERL_COMPILETIME
+Returns 1 if this macro is being called during the compilation phase of the
+program; otherwise 0;
 
+=for apidoc Amn|bool|IN_PERL_RUNTIME
+Returns 1 if this macro is being called during the execution phase of the
+program; otherwise 0;
 
+=cut
+*/
+#define IN_PERL_COMPILETIME     cBOOL(PL_curcop == &PL_compiling)
+#define IN_PERL_RUNTIME         cBOOL(PL_curcop != &PL_compiling)
 
 /*
 =for apidoc_section Multicall Functions