Advertisement
orgads

msc-gen fix xp

Aug 27th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.02 KB | None | 0 0
  1. Index: ContourTest/ContourTest.vcxproj
  2. ===================================================================
  3. --- ContourTest/ContourTest.vcxproj (revision 623)
  4. +++ ContourTest/ContourTest.vcxproj (working copy)
  5. @@ -37,7 +37,7 @@
  6.      <UseDebugLibraries>true</UseDebugLibraries>
  7.      <CharacterSet>NotSet</CharacterSet>
  8.      <PlatformToolset>v120</PlatformToolset>
  9. -    <UseOfMfc>Dynamic</UseOfMfc>
  10. +    <UseOfMfc>false</UseOfMfc>
  11.    </PropertyGroup>
  12.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
  13.      <ConfigurationType>Application</ConfigurationType>
  14. @@ -50,7 +50,7 @@
  15.      <UseDebugLibraries>true</UseDebugLibraries>
  16.      <CharacterSet>NotSet</CharacterSet>
  17.      <PlatformToolset>v120</PlatformToolset>
  18. -    <UseOfMfc>Dynamic</UseOfMfc>
  19. +    <UseOfMfc>false</UseOfMfc>
  20.    </PropertyGroup>
  21.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug64|x64'" Label="Configuration">
  22.      <ConfigurationType>Application</ConfigurationType>
  23. @@ -63,8 +63,8 @@
  24.      <UseDebugLibraries>false</UseDebugLibraries>
  25.      <WholeProgramOptimization>true</WholeProgramOptimization>
  26.      <CharacterSet>NotSet</CharacterSet>
  27. -    <PlatformToolset>v120</PlatformToolset>
  28. -    <UseOfMfc>Dynamic</UseOfMfc>
  29. +    <PlatformToolset>v120_xp</PlatformToolset>
  30. +    <UseOfMfc>false</UseOfMfc>
  31.    </PropertyGroup>
  32.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
  33.      <ConfigurationType>Application</ConfigurationType>
  34. Index: Msc-generator/Msc-generator.vcxproj
  35. ===================================================================
  36. --- Msc-generator/Msc-generator.vcxproj (revision 623)
  37. +++ Msc-generator/Msc-generator.vcxproj (working copy)
  38. @@ -33,7 +33,7 @@
  39.      <UseOfMfc>Dynamic</UseOfMfc>
  40.      <CharacterSet>NotSet</CharacterSet>
  41.      <WholeProgramOptimization>true</WholeProgramOptimization>
  42. -    <PlatformToolset>v120</PlatformToolset>
  43. +    <PlatformToolset>v120_xp</PlatformToolset>
  44.    </PropertyGroup>
  45.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='OptDebug|Win32'" Label="Configuration">
  46.      <ConfigurationType>Application</ConfigurationType>
  47. Index: libmscgen/libmscgen.vcxproj
  48. ===================================================================
  49. --- libmscgen/libmscgen.vcxproj (revision 623)
  50. +++ libmscgen/libmscgen.vcxproj (working copy)
  51. @@ -30,15 +30,15 @@
  52.    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  53.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MyRelease|Win32'" Label="Configuration">
  54.      <ConfigurationType>StaticLibrary</ConfigurationType>
  55. -    <UseOfMfc>Dynamic</UseOfMfc>
  56. +    <UseOfMfc>false</UseOfMfc>
  57.      <CharacterSet>NotSet</CharacterSet>
  58.      <PlatformToolset>v120</PlatformToolset>
  59.    </PropertyGroup>
  60.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  61.      <ConfigurationType>StaticLibrary</ConfigurationType>
  62. -    <UseOfMfc>Dynamic</UseOfMfc>
  63. +    <UseOfMfc>false</UseOfMfc>
  64.      <CharacterSet>NotSet</CharacterSet>
  65. -    <PlatformToolset>v120</PlatformToolset>
  66. +    <PlatformToolset>v120_xp</PlatformToolset>
  67.      <WholeProgramOptimization>true</WholeProgramOptimization>
  68.    </PropertyGroup>
  69.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='OptDebug|Win32'" Label="Configuration">
  70. @@ -49,7 +49,7 @@
  71.    </PropertyGroup>
  72.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
  73.      <ConfigurationType>StaticLibrary</ConfigurationType>
  74. -    <UseOfMfc>Dynamic</UseOfMfc>
  75. +    <UseOfMfc>false</UseOfMfc>
  76.      <CharacterSet>NotSet</CharacterSet>
  77.      <PlatformToolset>v120</PlatformToolset>
  78.    </PropertyGroup>
  79. Index: libpng/projects/visualc71/libpng.vcxproj
  80. ===================================================================
  81. --- libpng/projects/visualc71/libpng.vcxproj    (revision 623)
  82. +++ libpng/projects/visualc71/libpng.vcxproj    (working copy)
  83. @@ -63,7 +63,7 @@
  84.    </PropertyGroup>
  85.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LIB Release|Win32'" Label="Configuration">
  86.      <ConfigurationType>StaticLibrary</ConfigurationType>
  87. -    <UseOfMfc>Dynamic</UseOfMfc>
  88. +    <UseOfMfc>false</UseOfMfc>
  89.      <PlatformToolset>v120</PlatformToolset>
  90.      <CharacterSet>NotSet</CharacterSet>
  91.    </PropertyGroup>
  92. Index: msc-gen/msc-gen.cpp
  93. ===================================================================
  94. --- msc-gen/msc-gen.cpp (revision 623)
  95. +++ msc-gen/msc-gen.cpp (working copy)
  96. @@ -25,6 +25,8 @@
  97.  #include <fstream>
  98.  #include <sstream>
  99.  #include <assert.h>
  100. +#include <crtdbg.h>
  101. +#include <math.h>
  102.  #include "commandline.h"
  103.  #include "cairo.h"
  104.  #include "cairo-win32.h"
  105. @@ -107,8 +110,8 @@
  106.      return false;
  107.  }
  108.  
  109. -#define REG_SUBKEY_SETTINGS "Software\\Zoltan Turanyi\\Msc-generator\\Settings"
  110. -#define REG_KEY_LOAD_DATA "LoadData"
  111. +static const char REG_SUBKEY_SETTINGS[] = "Software\\Zoltan Turanyi\\Msc-generator\\Settings";
  112. +static const char REG_KEY_LOAD_DATA[] = "LoadData";
  113.  
  114.  int _tmain(int argc, _TCHAR* argv[])
  115.  {
  116. @@ -129,22 +132,27 @@
  117.      DWORD len=0;
  118.      char *buffer=NULL;
  119.      std::string load_data;
  120. -    LONG res = RegGetValue(HKEY_CURRENT_USER, REG_SUBKEY_SETTINGS,
  121. -                           REG_KEY_LOAD_DATA, RRF_RT_REG_SZ, NULL, NULL, &len);
  122. -    if (res==ERROR_MORE_DATA || res==ERROR_SUCCESS) {
  123. -        buffer = (char*)malloc(len+1);
  124. -        res = RegGetValue(HKEY_CURRENT_USER, REG_SUBKEY_SETTINGS,
  125. -                          REG_KEY_LOAD_DATA, RRF_RT_REG_SZ, NULL, buffer, &len);
  126. -        if (res==ERROR_SUCCESS && buffer) {
  127. -            buffer[len] = 0;
  128. -            load_data = buffer;
  129. +    HKEY SettingsKey;
  130. +    LONG res = RegCreateKeyEx(HKEY_CURRENT_USER, REG_SUBKEY_SETTINGS, 0, NULL, 0, KEY_READ | KEY_SET_VALUE, NULL, &SettingsKey, NULL);
  131. +    if (res==ERROR_SUCCESS)
  132. +    {
  133. +        res = RegQueryValueEx(SettingsKey, REG_KEY_LOAD_DATA, 0, NULL, NULL, &len);
  134. +        if (res==ERROR_MORE_DATA || res==ERROR_SUCCESS) {
  135. +            buffer = (char*)malloc(len+1);
  136. +            res = RegQueryValueEx(SettingsKey, REG_KEY_LOAD_DATA, 0, NULL, (LPBYTE)buffer, &len);
  137. +            if (res==ERROR_SUCCESS && buffer) {
  138. +                buffer[len] = 0;
  139. +                load_data = buffer;
  140. +            }
  141. +            free(buffer);
  142.          }
  143.      }
  144.  
  145. -    int ret = do_main(args, designs, "\\f(courier new)\\mn(12)",
  146. +    int ret = do_main(args, designs, "\\f(courier new)\\mn(12)",
  147.                        progressbar, hOut, load_data.length() ? &load_data : NULL);
  148. -    RegSetKeyValue(HKEY_CURRENT_USER, REG_SUBKEY_SETTINGS,
  149. -                   REG_KEY_LOAD_DATA, REG_SZ, load_data.c_str(), load_data.length()+1);
  150. +    if (res==ERROR_SUCCESS)
  151. +        RegSetValueEx(SettingsKey, REG_KEY_LOAD_DATA, 0, REG_SZ, (LPBYTE)load_data.c_str(), load_data.length()+1);
  152. +    RegCloseKey(SettingsKey);
  153.      return ret;
  154.  }
  155.  
  156. Index: msc-gen/msc-gen.vcxproj
  157. ===================================================================
  158. --- msc-gen/msc-gen.vcxproj (revision 623)
  159. +++ msc-gen/msc-gen.vcxproj (working copy)
  160. @@ -29,7 +29,7 @@
  161.      <UseOfMfc>false</UseOfMfc>
  162.      <CharacterSet>NotSet</CharacterSet>
  163.      <WholeProgramOptimization>true</WholeProgramOptimization>
  164. -    <PlatformToolset>v120</PlatformToolset>
  165. +    <PlatformToolset>v120_xp</PlatformToolset>
  166.    </PropertyGroup>
  167.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='OptDebug|Win32'" Label="Configuration">
  168.      <ConfigurationType>Application</ConfigurationType>
  169. Index: zlib/projects/visualc71/zlib.vcxproj
  170. ===================================================================
  171. --- zlib/projects/visualc71/zlib.vcxproj    (revision 623)
  172. +++ zlib/projects/visualc71/zlib.vcxproj    (working copy)
  173. @@ -59,7 +59,7 @@
  174.    </PropertyGroup>
  175.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LIB Release|Win32'" Label="Configuration">
  176.      <ConfigurationType>StaticLibrary</ConfigurationType>
  177. -    <UseOfMfc>Dynamic</UseOfMfc>
  178. +    <UseOfMfc>false</UseOfMfc>
  179.      <PlatformToolset>v120</PlatformToolset>
  180.      <CharacterSet>NotSet</CharacterSet>
  181.    </PropertyGroup>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement