OSDN Git Service

Some more build fixes.
authorLoRd_MuldeR <mulder2@gmx.de>
Sun, 2 Jul 2017 15:00:03 +0000 (17:00 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Sun, 2 Jul 2017 15:00:03 +0000 (17:00 +0200)
Make.cmd
bindings/Microsoft.NET/example/MHashDotNet384_Example.csproj
bindings/Microsoft.NET/example/src/App.xaml.cs
bindings/Microsoft.NET/example/src/MainWindow.xaml.cs
bindings/Microsoft.NET/library/src/MHash384.cs
bindings/Python/native/MHashPy384_Native.vcxproj
bindings/Python/native/src/MHashPy384.cpp

index 6f9d9d9..586d0ec 100644 (file)
--- a/Make.cmd
+++ b/Make.cmd
@@ -104,7 +104,7 @@ for %%i in (bin,obj) do (
 )
 
 for %%i in (Microsoft.NET,Java,Delphi,Python) do (
-       for %%j in (native,wrapper,example) do (
+       for %%j in (native,library,wrapper,example) do (
                for %%k in (bin,obj,out) do (
                        del /Q /S /F "%~dp0\bindings\%%i\%%j\%%k\*.*" 2> NUL
                )
@@ -125,11 +125,8 @@ REM ///////////////////////////////////////////////////////////////////////////
 call "%MSVC_PATH%\vcvarsall.bat"
 
 set "MSVC_PROJECTS=MHashLib.sln"
-::set "MSVC_PROJECTS=%MSVC_PROJECTS%,bindings\Python\native\MHashPy384_Native.sln"
+set "MSVC_PROJECTS=%MSVC_PROJECTS%,bindings\Python\native\MHashPy384_Native.sln"
 set "MSVC_PROJECTS=%MSVC_PROJECTS%,bindings\Delphi\native\MHashDelphi384.sln"
-
-set "DOTNET_PROJECTS=bindings\Microsoft.NET\MHashDotNet384.sln"
-
 for %%q in (%MSVC_PROJECTS%) do (
        for %%p in (x86,x64) do (
                "%~dp0\tools\cecho.exe" CYAN "\n----[ %%~nq (%%~p) ]----\n"
@@ -140,6 +137,7 @@ for %%q in (%MSVC_PROJECTS%) do (
        )
 )
 
+set "DOTNET_PROJECTS=bindings\Microsoft.NET\MHashDotNet384.sln"
 for %%q in (%DOTNET_PROJECTS%) do (
        "%~dp0\tools\cecho.exe" CYAN "\n----[ %%~nq (%%~p) ]----\n"
        MSBuild.exe /property:Platform="Any CPU" /property:Configuration=Release /target:Clean   "%~dp0\%%~q"
@@ -148,7 +146,6 @@ for %%q in (%DOTNET_PROJECTS%) do (
        if not "!ERRORLEVEL!"=="0" goto BuildHasFailed
 )
 
-
 for %%q in (example) do (
        echo pushd "%~dp0\bindings\Delphi\%%~q"
        pushd "%~dp0\bindings\Delphi\%%~q"
@@ -189,10 +186,8 @@ set REVISON=
 :GenerateOutfileNameNext
 set "OUT_PATH_BIN_X86=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.bin-msvc-x86.zip"
 set "OUT_PATH_BIN_X64=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.bin-msvc-x64.zip"
-set "OUT_PATH_NET_X86=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.dotnet-x86.zip"
-set "OUT_PATH_NET_X64=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.dotnet-x64.zip"
-set "OUT_PATH_JNI_X86=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.java-win-x86.zip"
-set "OUT_PATH_JNI_X64=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.java-win-x64.zip"
+set "OUT_PATH_NET_GEN=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.bin-dotnet.zip"
+set "OUT_PATH_JNI_GEN=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.bin-java.zip"
 set "OUT_PATH_PYC_X86=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.python-win-x86.zip"
 set "OUT_PATH_PYC_X64=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.python-win-x64.zip"
 set "OUT_PATH_PAS_X86=%~dp0\out\mhash_384.%ISO_DATE%%REVISON%.delphi-win-x86.zip"
@@ -203,10 +198,8 @@ set REVISON=.update-%COUNTER%
 
 if exist "%OUT_PATH_BIN_X86%" goto GenerateOutfileNameNext
 if exist "%OUT_PATH_BIN_X64%" goto GenerateOutfileNameNext
-if exist "%OUT_PATH_NET_X86%" goto GenerateOutfileNameNext
-if exist "%OUT_PATH_NET_X64%" goto GenerateOutfileNameNext
-if exist "%OUT_PATH_JNI_X86%" goto GenerateOutfileNameNext
-if exist "%OUT_PATH_JNI_X64%" goto GenerateOutfileNameNext
+if exist "%OUT_PATH_NET_GEN%" goto GenerateOutfileNameNext
+if exist "%OUT_PATH_JNI_GEN%" goto GenerateOutfileNameNext
 if exist "%OUT_PATH_PYC_X86%" goto GenerateOutfileNameNext
 if exist "%OUT_PATH_PYC_X64%" goto GenerateOutfileNameNext
 if exist "%OUT_PATH_PAS_X86%" goto GenerateOutfileNameNext
@@ -219,14 +212,12 @@ REM ///////////////////////////////////////////////////////////////////////////
 
 "%~dp0\tools\cecho.exe" YELLOW "\n========[ PACKAGING ]========\n"
 
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_BIN_X86%" "%~dp0\bin\Win32\Release\mhash_384.x86.exe" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_BIN_X64%" "%~dp0\bin\x64\.\Release\mhash_384.x64.exe" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
+"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_BIN_X86%" "%~dp0\bin\Win32\Release\mhash_384.x86.exe" "%~dp0\include\mhash_384.h" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
+"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_BIN_X64%" "%~dp0\bin\x64\.\Release\mhash_384.x64.exe" "%~dp0\include\mhash_384.h" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
 
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_NET_X86%" "%~dp0\bindings\Microsoft.NET\wrapper\bin\x86\Release\MHashDotNet384.x86.dll" "%~dp0\bindings\Microsoft.NET\example\bin\x86\Release\MHashDotNet384.exe" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_NET_X64%" "%~dp0\bindings\Microsoft.NET\wrapper\bin\x64\Release\MHashDotNet384.x64.dll" "%~dp0\bindings\Microsoft.NET\example\bin\x64\Release\MHashDotNet384.exe" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
+"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_NET_GEN%" "%~dp0\bindings\Microsoft.NET\library\bin\Release\MHashDotNet384.dll" "%~dp0\bindings\Microsoft.NET\example\bin\Release\MHashDotNet384.Example.exe" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
 
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_JNI_X86%" "%~dp0\bindings\Java\native\bin\x86\Release\MHashJava384.x86.dll" "%~dp0\bindings\Java\wrapper\out\MHashJava384-Wrapper.jar" "%~dp0\bindings\Java\example\out\MHashJava384-Example.jar" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
-"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_JNI_X64%" "%~dp0\bindings\Java\native\bin\x64\Release\MHashJava384.x64.dll" "%~dp0\bindings\Java\wrapper\out\MHashJava384-Wrapper.jar" "%~dp0\bindings\Java\example\out\MHashJava384-Example.jar" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
+"%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_JNI_GEN%" "%~dp0\bindings\Java\library\out\MHashJava384.jar" "%~dp0\bindings\Java\example\out\MHashJava384-Example.jar" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
 
 "%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_PYC_X86%" "%~dp0\bindings\Python\native\bin\x86\Release\MHashPy384_Native.x86.pyd" "%~dp0\bindings\Python\wrapper\MHashPy384_Wrapper.py" "%~dp0\bindings\Python\wrapper\mhash.pth" "%~dp0\bindings\Python\example\MHashPy384_Example.py" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
 "%~dp0\tools\zip.exe" -j -9 -z "%OUT_PATH_PYC_X64%" "%~dp0\bindings\Python\native\bin\x64\Release\MHashPy384_Native.x64.pyd" "%~dp0\bindings\Python\wrapper\MHashPy384_Wrapper.py" "%~dp0\bindings\Python\wrapper\mhash.pth" "%~dp0\bindings\Python\example\MHashPy384_Example.py" "%~dp0\README.html" "%~dp0\COPYING.txt" < "%~dp0\COPYING.txt"
index 3bc1a0c..b5f595b 100644 (file)
@@ -56,7 +56,7 @@
     <ApplicationIcon>exe.ico</ApplicationIcon>
   </PropertyGroup>
   <PropertyGroup>
-    <StartupObject>MHashDotNet384.Example.App</StartupObject>
+    <StartupObject>MHashDotNet384.Example.Startup</StartupObject>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
index 5617139..0bfc5ed 100644 (file)
@@ -22,6 +22,8 @@ using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 using System.Windows;
 
 namespace MHashDotNet384.Example
@@ -32,4 +34,55 @@ namespace MHashDotNet384.Example
     public partial class App : Application
     {
     }
+
+    internal static class Startup
+    {
+        [STAThread()]
+        [System.Diagnostics.DebuggerNonUserCode()]
+        public static void Main()
+        {
+#if DEBUG
+            LaunchApplication();
+#else
+            try
+            {
+                AppDomain.CurrentDomain.UnhandledException += UnhandeledExceptionHandler;
+                LaunchApplication();
+            }
+            catch (Exception e)
+            {
+                UnhandeledExceptionHandler(e);
+            }
+#endif
+        }
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private static void LaunchApplication()
+        {
+            App app = new App();
+            app.InitializeComponent();
+            app.Run();
+        }
+
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        private static void UnhandeledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
+        {
+            UnhandeledExceptionHandler(e.ExceptionObject as Exception);
+        }
+
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        private static void UnhandeledExceptionHandler(Exception e)
+        {
+            try
+            {
+                const String PREFIX = "A critical error has occurred, the application needs to terminate";
+                String text = String.IsNullOrWhiteSpace(e.Message) ? String.Concat(PREFIX, '!') : String.Concat(PREFIX, ":\n\n", e.Message);
+                MessageBox.Show(text, AppDomain.CurrentDomain.FriendlyName, MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+            finally
+            {
+                Environment.Exit(666);
+            }
+        }
+    }
 }
index 91edc97..c0d75fa 100644 (file)
@@ -47,7 +47,7 @@ namespace MHashDotNet384.Example
         private void Window_Loaded(object sender, RoutedEventArgs e)
         {
             ushort major, minor, patch;
-            MHashDotNet384.MHash384.GetVersion(out major, out minor, out patch);
+            MHash384.GetVersion(out major, out minor, out patch);
             Title += String.Format(" v{0:D}.{1:D}.{2:D}", major, minor, patch);
             KeyDown += new KeyEventHandler(KeyDownHandler);
         }
@@ -59,6 +59,7 @@ namespace MHashDotNet384.Example
                 if(e.Key == Key.F12)
                 {
                     SetBusy(true);
+                    e.Handled = true;
                     try
                     {
                         await Task.Run(() => MHash384.SelfTest());
index f4bffb5..e6aa955 100644 (file)
@@ -132,13 +132,15 @@ namespace MHashDotNet384
         // TestVector
         private struct TestVector
         {
+            private static readonly Encoding ENC_LATIN1 = Encoding.GetEncoding("ISO-8859-1");
+
             public readonly uint itrations;
-            public readonly String message;
+            public readonly ConstArray<byte> message;
 
             public TestVector(uint itrations, String message)
             {
                 this.itrations = itrations;
-                this.message = message;
+                this.message = new ConstArray<byte>(ENC_LATIN1.GetBytes(message));
             }
         }
 
@@ -1514,6 +1516,7 @@ namespace MHashDotNet384
             }
         }
 
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public override String ToString()
         {
             ConstArray<byte> digest = this.Digest;
@@ -1576,12 +1579,11 @@ namespace MHashDotNet384
             for (int i = 0; i < TEST_VECTOR.Length; ++i)
             {
                 MHash384 mhash384 = new MHash384();
-                ConstArray<byte> input = new ConstArray<byte>(Encoding.GetEncoding("ISO-8859-1").GetBytes(TEST_VECTOR[i].message));
                 for(int j = 0; j < TEST_VECTOR[i].itrations; ++j)
                 {
-                    mhash384.Update(input);
+                    mhash384.Update(TEST_VECTOR[i].message);
                 }
-                Trace.WriteLine(mhash384);
+                Trace.WriteLine(String.Format("TEST_VECTOR[{0:X}] = {1}", i, mhash384));
                 if (!mhash384.Digest.Equals(TEST_RESULT[i]))
                 {
                     throw new InvalidDataException("Test vector did NOT comapre equal!");
index 2c96477..86c315f 100644 (file)
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MHASHJAVA384_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_INC)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_HOME_INC)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(PYTHON_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(PYTHON_HOME_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;MHASHJAVA384_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_INC)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_HOME_INC)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(PYTHON_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(PYTHON_HOME_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MHASHJAVA384_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_INC)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_HOME_INC)</AdditionalIncludeDirectories>
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <OmitFramePointers>true</OmitFramePointers>
       <OptimizeReferences>true</OptimizeReferences>
       <GenerateDebugInformation>No</GenerateDebugInformation>
       <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
-      <AdditionalLibraryDirectories>$(PYTHON_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(PYTHON_HOME_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;MHASHJAVA384_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_INC)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\..\..\..\include;$(PYTHON_HOME_INC)</AdditionalIncludeDirectories>
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <OmitFramePointers>true</OmitFramePointers>
       <OptimizeReferences>true</OptimizeReferences>
       <GenerateDebugInformation>No</GenerateDebugInformation>
       <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
-      <AdditionalLibraryDirectories>$(PYTHON_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(PYTHON_HOME_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
index 9e71e76..be1bd9c 100644 (file)
@@ -29,7 +29,7 @@
 
 static PyObject *MHashPy384_Create(PyObject *const self, PyObject *const args)
 {
-       return PyLong_FromVoidPtr(new mhash::MHash384());
+       return PyLong_FromVoidPtr(new mhash_384::MHash384());
 }
 
 static PyObject *MHashPy384_Update(PyObject *const self, PyObject *const args)
@@ -50,7 +50,7 @@ static PyObject *MHashPy384_Update(PyObject *const self, PyObject *const args)
                                        const size_t sum = offset_val + len_val;
                                        if ((sum >= offset_val) && (sum >= len_val) && (sum <= total_size))
                                        {
-                                               reinterpret_cast<mhash::MHash384*>(inst_ptr)->update(reinterpret_cast<uint8_t*>(PyBytes_AsString(data)) + offset_val, len_val);
+                                               reinterpret_cast<mhash_384::MHash384*>(inst_ptr)->update(reinterpret_cast<uint8_t*>(PyBytes_AsString(data)) + offset_val, len_val);
                                                Py_RETURN_TRUE;
                                        }
                                }
@@ -62,7 +62,7 @@ static PyObject *MHashPy384_Update(PyObject *const self, PyObject *const args)
 
 static PyObject *MHashPy384_Result(PyObject *const self, PyObject *const args)
 {
-       uint8_t buffer[MHASH_384_LEN];
+       uint8_t buffer[mhash_384::MHash384::HASH_LEN];
        PyObject *instance = NULL;
        if (PyArg_UnpackTuple(args, "MHash384_Update", 1, 1, &instance))
        {
@@ -71,8 +71,8 @@ static PyObject *MHashPy384_Result(PyObject *const self, PyObject *const args)
                        void *const inst_ptr = PyLong_AsVoidPtr(instance);
                        if (inst_ptr)
                        {
-                               reinterpret_cast<mhash::MHash384*>(inst_ptr)->finalize(buffer);
-                               return PyByteArray_FromStringAndSize(reinterpret_cast<const char*>(buffer), MHASH_384_LEN);
+                               reinterpret_cast<mhash_384::MHash384*>(inst_ptr)->finalize(buffer);
+                               return PyByteArray_FromStringAndSize(reinterpret_cast<const char*>(buffer), mhash_384::MHash384::HASH_LEN);
                        }
                }
        }
@@ -89,7 +89,7 @@ static PyObject *MHashPy384_FreeUp(PyObject *const self, PyObject *const args)
                        void *const inst_ptr = PyLong_AsVoidPtr(instance);
                        if (inst_ptr)
                        {
-                               delete reinterpret_cast<mhash::MHash384*>(inst_ptr);
+                               delete reinterpret_cast<mhash_384::MHash384*>(inst_ptr);
                                Py_RETURN_TRUE;
                        }
                }
@@ -99,7 +99,9 @@ static PyObject *MHashPy384_FreeUp(PyObject *const self, PyObject *const args)
 
 static PyObject *MHashPy384_GetVer(PyObject *const self, PyObject *const args)
 {
-       return Py_BuildValue("(kkk)", MHASH_384_VERSION_MAJOR, MHASH_384_VERSION_MINOR, MHASH_384_VERSION_PATCH);
+       uint16_t major, minor, patch;
+       mhash_384::MHash384::version(major, minor, patch);
+       return Py_BuildValue("(kkk)", (uint32_t)major, (uint32_t)minor, (uint32_t)patch);
 }
 
 /* ------------------------------------------------------------------------*/