From 154b14fc549ab531410e9fe812cf776047c74971 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 10:33:12 -0700 Subject: [PATCH] Code review --- Common/CmdLineHelpers.h | 6 +++++- Texassemble/texassemble.cpp | 1 + Texconv/texconv.cpp | 1 + Texdiag/texdiag.cpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h index 1e5d8e23..b3af3ee5 100644 --- a/Common/CmdLineHelpers.h +++ b/Common/CmdLineHelpers.h @@ -23,6 +23,10 @@ #include #include +#ifndef TOOL_VERSION +#error Define TOOL_VERSION before including this header +#endif + namespace Helpers { @@ -164,7 +168,7 @@ namespace Helpers if (!*version || wcscmp(version, L"1.0.0.0") == 0) { - swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); + swprintf_s(version, L"%03d (library)", TOOL_VERSION); } if (versionOnly) diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 86e4c71b..91a9f543 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -75,6 +75,7 @@ #include "DirectXTexPNG.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers; diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index feae09aa..e096cc13 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -81,6 +81,7 @@ #include "DirectXTexXbox.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers; diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index cdbafdd3..c8a8e214 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -71,6 +71,7 @@ #include "DirectXTexPNG.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers;