summaryrefslogtreecommitdiff
path: root/ext/File/Glob/Glob.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/File/Glob/Glob.xs')
-rw-r--r--ext/File/Glob/Glob.xs18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/File/Glob/Glob.xs b/ext/File/Glob/Glob.xs
index 85ddf02e6d..f2210bcd04 100644
--- a/ext/File/Glob/Glob.xs
+++ b/ext/File/Glob/Glob.xs
@@ -4,8 +4,15 @@
#include "bsd_glob.h"
-/* XXX: need some thread awareness */
-static int GLOB_ERROR = 0;
+#define MY_CXT_KEY "File::Glob::_guts"##XS_VERSION
+
+typedef struct {
+ int x_GLOB_ERROR;
+} my_cxt_t;
+
+START_MY_CXT
+
+#define GLOB_ERROR (MY_CXT.x_GLOB_ERROR)
#include "constants.c"
@@ -20,6 +27,11 @@ errfunc(const char *foo, int bar) {
MODULE = File::Glob PACKAGE = File::Glob
+BOOT:
+{
+ MY_CXT_INIT;
+}
+
void
doglob(pattern,...)
char *pattern
@@ -32,6 +44,8 @@ PREINIT:
SV *tmp;
PPCODE:
{
+ dMY_CXT;
+
/* allow for optional flags argument */
if (items > 1) {
flags = (int) SvIV(ST(1));