From 6b6b495021a407d8644a11d391fbe0b3f544f8e4 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Mon, 14 Mar 2011 02:22:41 +0000 Subject: [PATCH] Make it easier to enforce the requirement that module version string exactly matches Audacity version string, by directly including Audacity.h and using AUDACITY_VERSION_STRING. --- lib-src/mod-script-pipe/ScripterCallback.cpp | 8 +++++++- lib-src/mod-script-pipe/ScripterCallback.h | 15 --------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/lib-src/mod-script-pipe/ScripterCallback.cpp b/lib-src/mod-script-pipe/ScripterCallback.cpp index dfae7fe59..8108789e0 100644 --- a/lib-src/mod-script-pipe/ScripterCallback.cpp +++ b/lib-src/mod-script-pipe/ScripterCallback.cpp @@ -13,6 +13,7 @@ #include #include "ScripterCallback.h" //#include "../lib_widget_extra/ShuttleGuiBase.h" +#include "../../src/Audacity.h" #include "../../src/ShuttleGui.h" #ifdef NOT_DEFINED @@ -177,7 +178,12 @@ int SCRIPT_PIPE_DLL_API ExtensionModuleInit(int ix) wxString SCRIPT_PIPE_DLL_API GetVersionString() { - return SCRIPT_PIPE_VERSION_STRING; + // Make sure that this version of the module requires the version + // of Audacity it is built with. + // For now, the versions must match exactly for Audacity to + // agree to load the module. + + return AUDACITY_VERSION_STRING; } } // End extern "C" diff --git a/lib-src/mod-script-pipe/ScripterCallback.h b/lib-src/mod-script-pipe/ScripterCallback.h index af644ec5e..9aadabff3 100644 --- a/lib-src/mod-script-pipe/ScripterCallback.h +++ b/lib-src/mod-script-pipe/ScripterCallback.h @@ -37,18 +37,3 @@ #endif #endif -// This should be set to the version of Audacity that this version of -// mod-scipt-pipe is designed to work with. For now, the versions must match -// exactly for Audacity to agree to load the module. -#define SCRIPT_PIPE_VERSION 1 -#define SCRIPT_PIPE_RELEASE 3 -#define SCRIPT_PIPE_REVISION 10 -#define SCRIPT_PIPE_SUFFIX wxT("-alpha-") __TDATE__ - -#define SCRIPT_PIPE_MAKESTR( x ) #x -#define SCRIPT_PIPE_QUOTE( x ) SCRIPT_PIPE_MAKESTR( x ) - -#define SCRIPT_PIPE_VERSION_STRING wxT( SCRIPT_PIPE_QUOTE( SCRIPT_PIPE_VERSION ) ) wxT(".") \ - wxT( SCRIPT_PIPE_QUOTE( SCRIPT_PIPE_RELEASE ) ) wxT(".") \ - wxT( SCRIPT_PIPE_QUOTE( SCRIPT_PIPE_REVISION ) ) \ - SCRIPT_PIPE_SUFFIX