From ff6b79085d7fbe48fa0a119261c2b91117177c1d Mon Sep 17 00:00:00 2001 From: refraction Date: Mon, 18 Jun 2012 21:16:25 +0000 Subject: [PATCH] Null Plugins: Now report an SVN revision as well as a version. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5306 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/CDVDnull/CDVD.cpp | 14 +++++++++++--- plugins/CDVDnull/CDVD.h | 1 - plugins/FWnull/FW.cpp | 12 ++++++++++-- plugins/GSnull/GS.cpp | 12 ++++++++++-- plugins/PadNull/Pad.cpp | 14 +++++++++++--- plugins/USBnull/USB.cpp | 13 ++++++++++--- plugins/dev9null/DEV9.cpp | 12 ++++++++++-- plugins/dev9null/DEV9.h | 1 - 8 files changed, 62 insertions(+), 17 deletions(-) diff --git a/plugins/CDVDnull/CDVD.cpp b/plugins/CDVDnull/CDVD.cpp index a5bda27b85..d5e771fac2 100644 --- a/plugins/CDVDnull/CDVD.cpp +++ b/plugins/CDVDnull/CDVD.cpp @@ -16,8 +16,11 @@ #include #include "CDVD.h" +#ifdef _MSC_VER +# include "svnrev.h" +#endif -const char *LibName = "CDVDnull Driver"; +static char libraryName[256]; const unsigned char version = PS2E_CDVD_VERSION; const unsigned char revision = 0; @@ -25,7 +28,12 @@ const unsigned char build = 6; EXPORT_C_(char*) PS2EgetLibName() { - return (char *)LibName; +#ifdef _MSC_VER + sprintf_s( libraryName, "CDVDnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "CDVDnull Driver"; +#endif } EXPORT_C_(u32) PS2EgetLibType() @@ -114,7 +122,7 @@ EXPORT_C_(void) CDVDconfigure() EXPORT_C_(void) CDVDabout() { - SysMessage("%s %d.%d", LibName, revision, build); + SysMessage("%s %d.%d", "CDVDnull Driver", revision, build); } EXPORT_C_(s32) CDVDtest() diff --git a/plugins/CDVDnull/CDVD.h b/plugins/CDVDnull/CDVD.h index a1d0dc9777..56bd489013 100644 --- a/plugins/CDVDnull/CDVD.h +++ b/plugins/CDVDnull/CDVD.h @@ -46,7 +46,6 @@ extern const unsigned char version; extern const unsigned char revision; extern const unsigned char build; extern const unsigned int minor; -extern const char *LibName; extern void SysMessage(const char *fmt, ...); #endif /* __CDVD_H__ */ diff --git a/plugins/FWnull/FW.cpp b/plugins/FWnull/FW.cpp index be68f68184..73ac4507ea 100644 --- a/plugins/FWnull/FW.cpp +++ b/plugins/FWnull/FW.cpp @@ -21,12 +21,15 @@ using namespace std; #include "FW.h" +#ifdef _MSC_VER +# include "svnrev.h" +#endif const u8 version = PS2E_FW_VERSION; const u8 revision = 0; const u8 build = 7; // increase that with each version -static char *libraryName = "FWnull Driver"; +static char libraryName[256]; string s_strIniPath="inis"; string s_strLogPath = "logs"; @@ -62,7 +65,12 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - return libraryName; +#ifdef _MSC_VER + sprintf_s( libraryName, "FWnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "FWnull Driver"; +#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 173b8297a1..c78847fe4f 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -27,12 +27,15 @@ using namespace std; #include "GS.h" #include "GifTransfer.h" #include "null/GSnull.h" +#ifdef _MSC_VER +# include "svnrev.h" +#endif const unsigned char version = PS2E_GS_VERSION; const unsigned char revision = 0; const unsigned char build = 1; // increase that with each version -static char *libraryName = "GSnull Driver"; +static char libraryName[256]; Config conf; u32 GSKeyEvent = 0; bool GSShift = false, GSAlt = false; @@ -60,7 +63,12 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - return libraryName; +#ifdef _MSC_VER + sprintf_s( libraryName, "GSnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "GSnull Driver"; +#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/PadNull/Pad.cpp b/plugins/PadNull/Pad.cpp index b84184b059..fd987061f4 100644 --- a/plugins/PadNull/Pad.cpp +++ b/plugins/PadNull/Pad.cpp @@ -18,14 +18,16 @@ #include #include using namespace std; - +#ifdef _MSC_VER +# include "svnrev.h" +#endif #include "Pad.h" const u8 version = PS2E_PAD_VERSION; const u8 revision = 0; const u8 build = 1; // increase that with each version -static char *libraryName = "Padnull Driver"; +static char libraryName[256]; string s_strIniPath="inis"; string s_strLogPath="logs"; @@ -41,7 +43,13 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - return libraryName; +#ifdef _MSC_VER + sprintf_s( libraryName, "Padnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "Padnull Driver"; +#endif + } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index 732948e78c..7b017259b5 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -16,7 +16,9 @@ #include #include using namespace std; - +#ifdef _MSC_VER +# include "svnrev.h" +#endif #include "USB.h" string s_strIniPath="inis"; string s_strLogPath="logs"; @@ -25,7 +27,7 @@ const unsigned char version = PS2E_USB_VERSION; const unsigned char revision = 0; const unsigned char build = 7; // increase that with each version -static char *libraryName = "USBnull Driver"; +static char libraryName[256]; USBcallback USBirq; Config conf; @@ -57,7 +59,12 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - return libraryName; +#ifdef _MSC_VER + sprintf_s( libraryName, "USBnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "USBnull Driver"; +#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index 2885f4deb2..615ab52c96 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -31,12 +31,15 @@ using namespace std; #include "DEV9.h" +#ifdef _MSC_VER +# include "svnrev.h" +#endif const unsigned char version = PS2E_DEV9_VERSION; const unsigned char revision = 0; const unsigned char build = 5; // increase that with each version -const char *libraryName = "DEV9null Driver"; +static char libraryName[256]; // Our IRQ call. void (*DEV9irq)(int); @@ -73,7 +76,12 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - return (char *)libraryName; +#ifdef _MSC_VER + sprintf_s( libraryName, "DEV9null Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + return libraryName; +#elif + return "DEV9null Driver"; +#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/dev9null/DEV9.h b/plugins/dev9null/DEV9.h index 95ff2728f0..8b7ec12b43 100644 --- a/plugins/dev9null/DEV9.h +++ b/plugins/dev9null/DEV9.h @@ -35,7 +35,6 @@ extern const unsigned char version; extern const unsigned char revision; extern const unsigned char build; extern const unsigned int minor; -extern const char *libraryName; void SaveConfig(); void LoadConfig();