PERL_FS_VER_FMT is only used with the current perl version, which is known at
authorNicholas Clark <nick@ccl4.org>
Mon, 16 Feb 2009 22:00:14 +0000 (22:00 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 14 Apr 2009 22:08:33 +0000 (23:08 +0100)
compile time, so replace it with PERL_FS_VERSION, a compile time constant.

(cherry-picked from commit b79b76e09d4ebd270b9df34cc7e92494ba4df212)

dosish.h
perl.c
perl.h
vms/vmsish.h

index 0981137..59bf122 100644 (file)
--- a/dosish.h
+++ b/dosish.h
 #  if (DJGPP==2 && DJGPP_MINOR < 2)
 #    define NO_LOCALECONV_MON_THOUSANDS_SEP
 #  endif
-#  define PERL_FS_VER_FMT      "%d_%d_%d"
+#  ifndef PERL_CORE
+#    define PERL_FS_VER_FMT    "%d_%d_%d"
+#  endif
+#  define PERL_FS_VERSION      STRINGIFY(PERL_REVISION) "_" \
+                               STRINGIFY(PERL_VERSION) "_" \
+                               STRINGIFY(PERL_SUBVERSION)
 #else  /* DJGPP */
 #  ifdef WIN32
 #    define PERL_SYS_INIT_BODY(c,v)                                    \
diff --git a/perl.c b/perl.c
index 0fecce6..68e1e08 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -5177,23 +5177,19 @@ S_incpush(pTHX_ const char *dir, bool addsubdirs, bool addoldvers, bool usesep,
            if (addsubdirs) {
 #ifdef MACOS_TRADITIONAL
 #define PERL_ARCH_FMT          "%s:"
-#define PERL_ARCH_FMT_PATH     PERL_FS_VER_FMT ""
+#define PERL_ARCH_FMT_PATH     PERL_FS_VERSION ""
 #else
 #define PERL_ARCH_FMT          "/%s"
-#define PERL_ARCH_FMT_PATH     "/" PERL_FS_VER_FMT
+#define PERL_ARCH_FMT_PATH     "/" PERL_FS_VERSION
 #endif
                /* .../version/archname if -d .../version/archname */
                Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT_PATH PERL_ARCH_FMT,
-                              SVfARG(libdir),
-                              (int)PERL_REVISION, (int)PERL_VERSION,
-                              (int)PERL_SUBVERSION, ARCHNAME);
+                              SVfARG(libdir), ARCHNAME);
                subdir = S_incpush_if_exists(aTHX_ subdir);
 
                /* .../version if -d .../version */
                Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT_PATH,
-                              SVfARG(libdir),
-                              (int)PERL_REVISION, (int)PERL_VERSION,
-                              (int)PERL_SUBVERSION);
+                              SVfARG(libdir));
                subdir = S_incpush_if_exists(aTHX_ subdir);
 
                /* .../archname if -d .../archname */
diff --git a/perl.h b/perl.h
index a67cfab..4155ccb 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3081,10 +3081,18 @@ typedef pthread_key_t   perl_key;
 #  define MEMBER_TO_FPTR(name)         name
 #endif
 
+#ifndef PERL_CORE
 /* format to use for version numbers in file/directory names */
 /* XXX move to Configure? */
-#ifndef PERL_FS_VER_FMT
-#  define PERL_FS_VER_FMT      "%d.%d.%d"
+/* This was only ever used for the current version, and that can be done at
+   compile time, as PERL_FS_VERSION, so should we just delete it?  */
+#  ifndef PERL_FS_VER_FMT
+#    define PERL_FS_VER_FMT    "%d.%d.%d"
+#  endif
+#endif
+
+#ifndef PERL_FS_VERSION
+#  define PERL_FS_VERSION      PERL_VERSION_STRING
 #endif
 
 /* This defines a way to flush all output buffers.  This may be a
index b70d42f..95ac23b 100644 (file)
@@ -418,7 +418,12 @@ struct interp_intern {
 #define HAS_KILL
 #define HAS_WAIT
 
-#define PERL_FS_VER_FMT                "%d_%d_%d"
+#ifndef PERL_CORE
+#  define PERL_FS_VER_FMT      "%d_%d_%d"
+#endif
+#define PERL_FS_VERSION                STRINGIFY(PERL_REVISION) "_" \
+                               STRINGIFY(PERL_VERSION) "_" \
+                               STRINGIFY(PERL_SUBVERSION)
 /* Temporary; we need to add support for this to Configure.Com */
 #ifdef PERL_INC_VERSION_LIST
 #  undef PERL_INC_VERSION_LIST