]> granicus.if.org Git - graphviz/commitdiff
Made vmalloc a static library on Windows
authorErwin Janssen <erwinjanssen@outlook.com>
Thu, 5 Jan 2017 23:59:09 +0000 (00:59 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Tue, 17 Jan 2017 18:14:54 +0000 (19:14 +0100)
vmalloc is a static library with the Autotools build, but was for some
reason a dynamic library on Windows. Since Autotools is considered the
default, this commit makes vmalloc a static library on Windows as well.
To disable the function export that is required for a dynamic library,
but not for a static one, various define checks were removed.

graphviz.sln
lib/vmalloc/vmalloc.h
lib/vmalloc/vmalloc.vcxproj

index 70580060c6f624efd1114bfafb18e82a9f534060..0b455214866bfb7dbaf6595875e155781f78eda9 100644 (file)
@@ -43,6 +43,9 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpsc", "lib\vpsc\vpsc.vcxproj", "{2F5A730B-132C-4319-A1B3-DCBE05E2E1B1}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gvpr", "cmd\gvpr\gvpr.vcxproj", "{397C6B2C-B305-4CB2-B8CE-2366B508AB7C}"
+       ProjectSection(ProjectDependencies) = postProject
+               {D6FD0DE5-5305-458E-8CA5-FCA4B8E05B04} = {D6FD0DE5-5305-458E-8CA5-FCA4B8E05B04}
+       EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ingraphs", "lib\ingraphs\ingraphs.vcxproj", "{D6FD0DE5-5305-458E-8CA5-FCA4B8E05B04}"
 EndProject
index 0864da960121105e2e31cba5da05df1d5bf7a9d8..1f5674a014744661a58db4663781bb3edeaede4c 100644 (file)
@@ -101,25 +101,8 @@ extern "C" {
 #define VM_BADADDR     3       /* bad addr in vmfree/vmresize  */
 #define VM_DISC                4       /* discipline being changed     */
 
-/* public data */
-#if _BLD_vmalloc && defined(__EXPORT__)
-#define extern __EXPORT__
-#endif
-#if !_BLD_vmalloc && defined(__IMPORT__)
-#define extern __IMPORT__
-#endif
 
-/*visual studio*/
-#ifdef WIN32
-#undef extern
-#ifndef VMALLOC_EXPORTS
-#define extern __declspec(dllimport)
-#else
-#define extern __declspec(dllexport)
-#endif
-#endif
-/*end visual studio*/           
-                extern Vmethod_t *Vmbest;      /* best allocation              */
+    extern Vmethod_t *Vmbest;  /* best allocation              */
     extern Vmethod_t *Vmlast;  /* last-block allocation        */
     extern Vmethod_t *Vmpool;  /* pool allocation              */
     extern Vmethod_t *Vmdebug; /* allocation with debugging    */
@@ -131,11 +114,7 @@ extern "C" {
     extern Vmalloc_t *Vmheap;  /* heap region                  */
     extern Vmalloc_t *Vmregion;        /* malloc region                */
 
-/* public functions */
-#if _BLD_vmalloc && defined(__EXPORT__)
-#define extern __EXPORT__
-#endif
-     extern Vmalloc_t *vmopen(Vmdisc_t *, Vmethod_t *, int);
+    extern Vmalloc_t *vmopen(Vmdisc_t *, Vmethod_t *, int);
     extern int vmclose(Vmalloc_t *);
     extern int vmclear(Vmalloc_t *);
     extern int vmcompact(Vmalloc_t *);
@@ -170,8 +149,6 @@ extern "C" {
     extern char *vmstrdup(Vmalloc_t *, const char *);
 
 
-#undef extern
-
 /* to coerce any value to a Vmalloc_t*, make ANSI happy */
 #define _VM_(vm)       ((Vmalloc_t*)(vm))
 /* enable recording of where a call originates from */
index b3fbe8a2aa5235e21118ccf547c2d42c5f16f277..1d80d104f7d28d1af48199eb2691d628d84c18c8 100644 (file)
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
     <PlatformToolset>v140</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
     <PlatformToolset>v140</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -52,7 +52,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>$(SolutionDir)windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32_DLL;VMALLOC_EXPORTS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <DataExecutionPrevention />
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <Lib>
+      <SubSystem>Console</SubSystem>
+    </Lib>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <AdditionalIncludeDirectories>$(SolutionDir)windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;VMALLOC_EXPORTS;WIN32_DLL;MSWIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;MSWIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <PrecompiledHeader />
@@ -85,6 +88,9 @@
       <DataExecutionPrevention />
       <GenerateDebugInformation>No</GenerateDebugInformation>
     </Link>
+    <Lib>
+      <SubSystem>Console</SubSystem>
+    </Lib>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="vmalloc.h" />