DXGL r941 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r940‎ | r941 | r942 >
Date:22:40, 25 August 2019
Author:admin
Status:new
Tags:
Comment:
Add VS2005 project for dxgl-nsis
Fix compilation of dxgl-nsis on VS2005 and add public domain stdint.h
Modified paths:
  • /ThirdParty.txt (modified) (history)
  • /dxgl-nsis/LibSha512.h (modified) (history)
  • /dxgl-nsis/dxgl-nsis.c (modified) (history)
  • /dxgl-nsis/dxgl-nsis.vcxproj (modified) (history)
  • /dxgl-nsis/dxgl-nsis.vcxproj.filters (modified) (history)
  • /dxgl-nsis/stdint.h (added) (history)
  • /vs8/dxgl-nsis (added) (history)
  • /vs8/dxgl-nsis/dxgl-nsis.vcproj (added) (history)
  • /vs8/dxgl-vs8.sln (modified) (history)

Diff [purge]

Index: ThirdParty.txt
@@ -216,10 +216,15 @@
217217 ------------------------------------------------------------------------------
218218
219219 Installer uses Nullsoft Scriptable Install System; the license for which
220 -can be viewed at http://nsis.sourceforge.net/License
 220+can be viewed at https://nsis.sourceforge.io/License
221221
222222 ------------------------------------------------------------------------------
223223
 224+Installer plugin utilizes public domain stdint.h from Danny Smith, published
 225+at https://www.rpi.edu/dept/cis/software/g77-mingw32/include/stdint.h
 226+
 227+------------------------------------------------------------------------------
 228+
224229 Contains some GLSL code derived from Nervous Systems ffmpeg-opengl YUV feature,
225230 original code from:
226231 https://github.com/nervous-systems/ffmpeg-opengl/blob/feature/yuv/vf_genericshader.c
Index: dxgl-nsis/LibSha512.h
@@ -15,7 +15,7 @@
1616 // IMPORTS
1717 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1818
19 -#include <stdint.h>
 19+#include "stdint.h"
2020 #include <stdio.h>
2121
2222 typedef struct
Index: dxgl-nsis/dxgl-nsis.c
@@ -12,6 +12,12 @@
1313 #include "LibSha512.h"
1414 #include "pluginapi.h"
1515 #include <intrin.h>
 16+#ifdef _MSC_VER
 17+#if (_MSC_VER < 1500)
 18+#pragma function (memcpy)
 19+#pragma function (memcmp)
 20+#endif
 21+#endif
1622 #ifndef _TCHAR_DEFINED
1723 #include <tchar.h>
1824 #endif
Index: dxgl-nsis/dxgl-nsis.vcxproj
@@ -168,6 +168,7 @@
169169 <ClInclude Include="api.h" />
170170 <ClInclude Include="LibSha512.h" />
171171 <ClInclude Include="pluginapi.h" />
 172+ <ClInclude Include="stdint.h" />
172173 </ItemGroup>
173174 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
174175 <ImportGroup Label="ExtensionTargets">
Index: dxgl-nsis/dxgl-nsis.vcxproj.filters
@@ -35,5 +35,8 @@
3636 <ClInclude Include="pluginapi.h">
3737 <Filter>Header Files</Filter>
3838 </ClInclude>
 39+ <ClInclude Include="stdint.h">
 40+ <Filter>Header Files</Filter>
 41+ </ClInclude>
3942 </ItemGroup>
4043 </Project>
\ No newline at end of file
Index: dxgl-nsis/stdint.h
@@ -0,0 +1,184 @@
 2+/* ISO C9x 7.18 Integer types <stdint.h>
 3+ * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
 4+ *
 5+ * THIS SOFTWARE IS NOT COPYRIGHTED
 6+ *
 7+ * Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
 8+ *
 9+ * This source code is offered for use in the public domain. You may
 10+ * use, modify or distribute it freely.
 11+ *
 12+ * This code is distributed in the hope that it will be useful but
 13+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
 14+ * DISCLAMED. This includes but is not limited to warranties of
 15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 16+ *
 17+ * Date: 2000-12-02
 18+ */
 19+
 20+
 21+#ifndef _STDINT_H
 22+#define _STDINT_H
 23+
 24+/* 7.18.1.1 Exact-width integer types */
 25+typedef signed char int8_t;
 26+typedef unsigned char uint8_t;
 27+typedef short int16_t;
 28+typedef unsigned short uint16_t;
 29+typedef int int32_t;
 30+typedef unsigned uint32_t;
 31+typedef long long int64_t;
 32+typedef unsigned long long uint64_t;
 33+
 34+/* 7.18.1.2 Minimum-width integer types */
 35+typedef signed char int_least8_t;
 36+typedef unsigned char uint_least8_t;
 37+typedef short int_least16_t;
 38+typedef unsigned short uint_least16_t;
 39+typedef int int_least32_t;
 40+typedef unsigned uint_least32_t;
 41+typedef long long int_least64_t;
 42+typedef unsigned long long uint_least64_t;
 43+
 44+/* 7.18.1.3 Fastest minimum-width integer types
 45+ * Not actually guaranteed to be fastest for all purposes
 46+ * Here we use the exact-width types for 8 and 16-bit ints.
 47+ */
 48+typedef char int_fast8_t;
 49+typedef unsigned char uint_fast8_t;
 50+typedef short int_fast16_t;
 51+typedef unsigned short uint_fast16_t;
 52+typedef int int_fast32_t;
 53+typedef unsigned int uint_fast32_t;
 54+typedef long long int_fast64_t;
 55+typedef unsigned long long uint_fast64_t;
 56+
 57+/* 7.18.1.4 Integer types capable of holding object pointers */
 58+typedef int intptr_t;
 59+typedef unsigned uintptr_t;
 60+
 61+/* 7.18.1.5 Greatest-width integer types */
 62+typedef long long intmax_t;
 63+typedef unsigned long long uintmax_t;
 64+
 65+/* 7.18.2 Limits of specified-width integer types */
 66+#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
 67+
 68+/* 7.18.2.1 Limits of exact-width integer types */
 69+#define INT8_MIN (-128)
 70+#define INT16_MIN (-32768)
 71+#define INT32_MIN (-2147483647 - 1)
 72+#define INT64_MIN (-9223372036854775807LL - 1)
 73+
 74+#define INT8_MAX 127
 75+#define INT16_MAX 32767
 76+#define INT32_MAX 2147483647
 77+#define INT64_MAX 9223372036854775807LL
 78+
 79+#define UINT8_MAX 0xff /* 255U */
 80+#define UINT16_MAX 0xffff /* 65535U */
 81+#define UINT32_MAX 0xffffffff /* 4294967295U */
 82+#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
 83+
 84+/* 7.18.2.2 Limits of minimum-width integer types */
 85+#define INT_LEAST8_MIN INT8_MIN
 86+#define INT_LEAST16_MIN INT16_MIN
 87+#define INT_LEAST32_MIN INT32_MIN
 88+#define INT_LEAST64_MIN INT64_MIN
 89+
 90+#define INT_LEAST8_MAX INT8_MAX
 91+#define INT_LEAST16_MAX INT16_MAX
 92+#define INT_LEAST32_MAX INT32_MAX
 93+#define INT_LEAST64_MAX INT64_MAX
 94+
 95+#define UINT_LEAST8_MAX UINT8_MAX
 96+#define UINT_LEAST16_MAX UINT16_MAX
 97+#define UINT_LEAST32_MAX UINT32_MAX
 98+#define UINT_LEAST64_MAX UINT64_MAX
 99+
 100+/* 7.18.2.3 Limits of fastest minimum-width integer types */
 101+#define INT_FAST8_MIN INT8_MIN
 102+#define INT_FAST16_MIN INT16_MIN
 103+#define INT_FAST32_MIN INT32_MIN
 104+#define INT_FAST64_MIN INT64_MIN
 105+
 106+#define INT_FAST8_MAX INT8_MAX
 107+#define INT_FAST16_MAX INT16_MAX
 108+#define INT_FAST32_MAX INT32_MAX
 109+#define INT_FAST64_MAX INT64_MAX
 110+
 111+#define UINT_FAST8_MAX UINT8_MAX
 112+#define UINT_FAST16_MAX UINT16_MAX
 113+#define UINT_FAST32_MAX UINT32_MAX
 114+#define UINT_FAST64_MAX UINT64_MAX
 115+
 116+/* 7.18.2.4 Limits of integer types capable of holding
 117+ object pointers */
 118+#define INTPTR_MIN INT32_MIN
 119+#define INTPTR_MAX INT32_MAX
 120+#define UINTPTR_MAX UINT32_MAX
 121+
 122+/* 7.18.2.5 Limits of greatest-width integer types */
 123+#define INTMAX_MIN INT64_MIN
 124+#define INTMAX_MAX INT64_MAX
 125+#define UINTMAX_MAX UINT64_MAX
 126+
 127+/* 7.18.3 Limits of other integer types */
 128+#define PTRDIFF_MIN INT32_MIN
 129+#define PTRDIFF_MAX INT32_MAX
 130+
 131+#define SIG_ATOMIC_MIN INT32_MIN
 132+#define SIG_ATOMIC_MAX INT32_MAX
 133+
 134+#define SIZE_MAX UINT32_MAX
 135+
 136+#ifndef WCHAR_MIN /* also in wchar.h */
 137+#define WCHAR_MIN 0
 138+#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
 139+#endif
 140+
 141+/*
 142+ * wint_t is unsigned int in __MINGW32__,
 143+ * but unsigned short in MS runtime
 144+ */
 145+#define WINT_MIN 0
 146+#define WINT_MAX UINT32_MAX
 147+
 148+#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
 149+
 150+
 151+/* 7.18.4 Macros for integer constants */
 152+#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
 153+
 154+/* 7.18.4.1 Macros for minimum-width integer constants
 155+
 156+ Accoding to Douglas Gwyn <gwyn@arl.mil>:
 157+ "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
 158+ 9899:1999 as initially published, the expansion was required
 159+ to be an integer constant of precisely matching type, which
 160+ is impossible to accomplish for the shorter types on most
 161+ platforms, because C99 provides no standard way to designate
 162+ an integer constant with width less than that of type int.
 163+ TC1 changed this to require just an integer constant
 164+ *expression* with *promoted* type."
 165+
 166+ The trick used here is from Clive D W Feather.
 167+*/
 168+
 169+#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
 170+#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
 171+#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
 172+#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val))
 173+
 174+#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
 175+#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
 176+#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
 177+#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val))
 178+
 179+/* 7.18.4.2 Macros for greatest-width integer constants */
 180+#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val))
 181+#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val))
 182+
 183+#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
 184+
 185+#endif
\ No newline at end of file
Index: vs8/dxgl-nsis/dxgl-nsis.vcproj
@@ -0,0 +1,232 @@
 2+<?xml version="1.0" encoding="Windows-1252"?>
 3+<VisualStudioProject
 4+ ProjectType="Visual C++"
 5+ Version="8.00"
 6+ Name="dxgl-nsis"
 7+ ProjectGUID="{EBF0828E-7C19-4FEF-BFF8-41035FA17C71}"
 8+ RootNamespace="dxglnsis"
 9+ Keyword="Win32Proj"
 10+ >
 11+ <Platforms>
 12+ <Platform
 13+ Name="Win32"
 14+ />
 15+ </Platforms>
 16+ <ToolFiles>
 17+ </ToolFiles>
 18+ <Configurations>
 19+ <Configuration
 20+ Name="Debug|Win32"
 21+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
 22+ IntermediateDirectory="$(ConfigurationName)"
 23+ ConfigurationType="2"
 24+ CharacterSet="1"
 25+ >
 26+ <Tool
 27+ Name="VCPreBuildEventTool"
 28+ />
 29+ <Tool
 30+ Name="VCCustomBuildTool"
 31+ />
 32+ <Tool
 33+ Name="VCXMLDataGeneratorTool"
 34+ />
 35+ <Tool
 36+ Name="VCWebServiceProxyGeneratorTool"
 37+ />
 38+ <Tool
 39+ Name="VCMIDLTool"
 40+ />
 41+ <Tool
 42+ Name="VCCLCompilerTool"
 43+ Optimization="0"
 44+ WholeProgramOptimization="false"
 45+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DXGLNSIS_EXPORTS"
 46+ MinimalRebuild="true"
 47+ BasicRuntimeChecks="0"
 48+ RuntimeLibrary="3"
 49+ BufferSecurityCheck="false"
 50+ UsePrecompiledHeader="0"
 51+ WarningLevel="3"
 52+ Detect64BitPortabilityProblems="true"
 53+ DebugInformationFormat="4"
 54+ />
 55+ <Tool
 56+ Name="VCManagedResourceCompilerTool"
 57+ />
 58+ <Tool
 59+ Name="VCResourceCompilerTool"
 60+ />
 61+ <Tool
 62+ Name="VCPreLinkEventTool"
 63+ />
 64+ <Tool
 65+ Name="VCLinkerTool"
 66+ LinkIncremental="2"
 67+ GenerateManifest="false"
 68+ IgnoreAllDefaultLibraries="true"
 69+ GenerateDebugInformation="true"
 70+ SubSystem="2"
 71+ EntryPointSymbol="DllMain"
 72+ TargetMachine="1"
 73+ />
 74+ <Tool
 75+ Name="VCALinkTool"
 76+ />
 77+ <Tool
 78+ Name="VCManifestTool"
 79+ />
 80+ <Tool
 81+ Name="VCXDCMakeTool"
 82+ />
 83+ <Tool
 84+ Name="VCBscMakeTool"
 85+ />
 86+ <Tool
 87+ Name="VCFxCopTool"
 88+ />
 89+ <Tool
 90+ Name="VCAppVerifierTool"
 91+ />
 92+ <Tool
 93+ Name="VCWebDeploymentTool"
 94+ />
 95+ <Tool
 96+ Name="VCPostBuildEventTool"
 97+ />
 98+ </Configuration>
 99+ <Configuration
 100+ Name="Release|Win32"
 101+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
 102+ IntermediateDirectory="$(ConfigurationName)"
 103+ ConfigurationType="2"
 104+ CharacterSet="1"
 105+ WholeProgramOptimization="1"
 106+ >
 107+ <Tool
 108+ Name="VCPreBuildEventTool"
 109+ />
 110+ <Tool
 111+ Name="VCCustomBuildTool"
 112+ />
 113+ <Tool
 114+ Name="VCXMLDataGeneratorTool"
 115+ />
 116+ <Tool
 117+ Name="VCWebServiceProxyGeneratorTool"
 118+ />
 119+ <Tool
 120+ Name="VCMIDLTool"
 121+ />
 122+ <Tool
 123+ Name="VCCLCompilerTool"
 124+ WholeProgramOptimization="false"
 125+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DXGLNSIS_EXPORTS"
 126+ RuntimeLibrary="2"
 127+ BufferSecurityCheck="false"
 128+ EnableFunctionLevelLinking="true"
 129+ UsePrecompiledHeader="0"
 130+ WarningLevel="3"
 131+ Detect64BitPortabilityProblems="true"
 132+ DebugInformationFormat="3"
 133+ />
 134+ <Tool
 135+ Name="VCManagedResourceCompilerTool"
 136+ />
 137+ <Tool
 138+ Name="VCResourceCompilerTool"
 139+ />
 140+ <Tool
 141+ Name="VCPreLinkEventTool"
 142+ />
 143+ <Tool
 144+ Name="VCLinkerTool"
 145+ LinkIncremental="1"
 146+ GenerateManifest="false"
 147+ IgnoreAllDefaultLibraries="true"
 148+ GenerateDebugInformation="true"
 149+ SubSystem="2"
 150+ OptimizeReferences="2"
 151+ EnableCOMDATFolding="2"
 152+ EntryPointSymbol="DllMain"
 153+ TargetMachine="1"
 154+ />
 155+ <Tool
 156+ Name="VCALinkTool"
 157+ />
 158+ <Tool
 159+ Name="VCManifestTool"
 160+ />
 161+ <Tool
 162+ Name="VCXDCMakeTool"
 163+ />
 164+ <Tool
 165+ Name="VCBscMakeTool"
 166+ />
 167+ <Tool
 168+ Name="VCFxCopTool"
 169+ />
 170+ <Tool
 171+ Name="VCAppVerifierTool"
 172+ />
 173+ <Tool
 174+ Name="VCWebDeploymentTool"
 175+ />
 176+ <Tool
 177+ Name="VCPostBuildEventTool"
 178+ />
 179+ </Configuration>
 180+ </Configurations>
 181+ <References>
 182+ </References>
 183+ <Files>
 184+ <Filter
 185+ Name="Source Files"
 186+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
 187+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 188+ >
 189+ <File
 190+ RelativePath="..\..\dxgl-nsis\dxgl-nsis.c"
 191+ >
 192+ </File>
 193+ <File
 194+ RelativePath="..\..\dxgl-nsis\LibSha512.c"
 195+ >
 196+ </File>
 197+ <File
 198+ RelativePath="..\..\dxgl-nsis\pluginapi.c"
 199+ >
 200+ </File>
 201+ </Filter>
 202+ <Filter
 203+ Name="Header Files"
 204+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
 205+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 206+ >
 207+ <File
 208+ RelativePath="..\..\dxgl-nsis\api.h"
 209+ >
 210+ </File>
 211+ <File
 212+ RelativePath="..\..\dxgl-nsis\LibSha512.h"
 213+ >
 214+ </File>
 215+ <File
 216+ RelativePath="..\..\dxgl-nsis\pluginapi.h"
 217+ >
 218+ </File>
 219+ <File
 220+ RelativePath="..\..\dxgl-nsis\stdint.h"
 221+ >
 222+ </File>
 223+ </Filter>
 224+ <Filter
 225+ Name="Resource Files"
 226+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
 227+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
 228+ >
 229+ </Filter>
 230+ </Files>
 231+ <Globals>
 232+ </Globals>
 233+</VisualStudioProject>
Index: vs8/dxgl-nsis
Property changes on: vs8/dxgl-nsis
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,3 ##
 234+Debug
 235+*.user
 236+Release
Index: vs8/dxgl-vs8.sln
@@ -25,6 +25,8 @@
2626 {3AB68EF6-DA0B-4B6D-A749-08F945F63424} = {3AB68EF6-DA0B-4B6D-A749-08F945F63424}
2727 EndProjectSection
2828 EndProject
 29+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxgl-nsis", "dxgl-nsis\dxgl-nsis.vcproj", "{EBF0828E-7C19-4FEF-BFF8-41035FA17C71}"
 30+EndProject
2931 Global
3032 GlobalSection(SolutionConfigurationPlatforms) = preSolution
3133 Debug No DXGL|Win32 = Debug No DXGL|Win32
@@ -68,6 +70,12 @@
6971 {8A6EAE90-2389-4211-B10F-57C7CADC7FA1}.Debug|Win32.Build.0 = Debug|Win32
7072 {8A6EAE90-2389-4211-B10F-57C7CADC7FA1}.Release|Win32.ActiveCfg = Release|Win32
7173 {8A6EAE90-2389-4211-B10F-57C7CADC7FA1}.Release|Win32.Build.0 = Release|Win32
 74+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Debug No DXGL|Win32.ActiveCfg = Debug|Win32
 75+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Debug No DXGL|Win32.Build.0 = Debug|Win32
 76+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Debug|Win32.ActiveCfg = Debug|Win32
 77+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Debug|Win32.Build.0 = Debug|Win32
 78+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Release|Win32.ActiveCfg = Release|Win32
 79+ {EBF0828E-7C19-4FEF-BFF8-41035FA17C71}.Release|Win32.Build.0 = Release|Win32
7280 EndGlobalSection
7381 GlobalSection(SolutionProperties) = preSolution
7482 HideSolutionNode = FALSE