summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-10-02 07:38:56 -0600
committerKarl Williamson <khw@cpan.org>2022-10-06 10:15:15 -0600
commiteb70e108736fa063e8fba2e14dcb70e3dacfa9ee (patch)
treef659cf4ae4075d46961dc1b4cdecf43cc27ca14a /locale.c
parenta6d93489384955135787c629ab114fb3b15b3613 (diff)
downloadperl-eb70e108736fa063e8fba2e14dcb70e3dacfa9ee.tar.gz
locale.c: Display thread in DEBUG statements
This makes it easier to understand what's going on in threaded perls.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/locale.c b/locale.c
index 489f833fa9..fe8396dc2a 100644
--- a/locale.c
+++ b/locale.c
@@ -121,15 +121,23 @@
static int debug_initialization = 0;
# define DEBUG_INITIALIZATION_set(v) (debug_initialization = v)
# define DEBUG_LOCALE_INITIALIZATION_ debug_initialization
+# ifdef USE_LOCALE_THREADS
+# define DEBUG_PRE_STMTS \
+ dSAVE_ERRNO; dTHX; PerlIO_printf(Perl_debug_log,"\n%s: %" LINE_Tf ": %p: ",\
+ __FILE__, __LINE__, aTHX);
+# else
+# define DEBUG_PRE_STMTS \
+ dSAVE_ERRNO; dTHX; PerlIO_printf(Perl_debug_log, "\n%s: %" LINE_Tf ": ", \
+ __FILE__, __LINE__);
+# endif
+# define DEBUG_POST_STMTS RESTORE_ERRNO;
#else
# define debug_initialization 0
# define DEBUG_INITIALIZATION_set(v)
+# define DEBUG_PRE_STMTS
+# define DEBUG_POST_STMTS
#endif
-#define DEBUG_PRE_STMTS dSAVE_ERRNO; \
- PerlIO_printf(Perl_debug_log, "%s: %" LINE_Tf ": ", __FILE__, __LINE__);
-#define DEBUG_POST_STMTS RESTORE_ERRNO;
-
#include "EXTERN.h"
#define PERL_IN_LOCALE_C
#include "perl.h"