]> granicus.if.org Git - graphviz/commitdiff
convert Mingle to C++
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Dec 2021 19:05:47 +0000 (11:05 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 4 Jan 2022 15:58:22 +0000 (07:58 -0800)
cmd/mingle depends on lib/mingle, which in turn depends on libANN, a C++
library. Thus the `mingle` binary needs to link against the C++ standard
library. There is no advantage to Mingle being implemented in C, and some nice
advantages to it being implemented in C++ instead.

This commit does a basic rename, as AFAICT nothing in minglemain.c has varying
semantics between C and C++. Future commits will use C++ features to simplify
the code.

Related to #2154.

cmd/mingle/Makefile.am
cmd/mingle/mingle.vcxproj
cmd/mingle/mingle.vcxproj.filters
cmd/mingle/minglemain.cpp [moved from cmd/mingle/minglemain.c with 100% similarity]

index a2154d39d62154d53dabc74e9ebb56c5f6ce794a..d9af2411b1c2d9cf9a6509702aa9544feb197fe3 100644 (file)
@@ -25,7 +25,7 @@ else
 pdf =
 endif
 
-mingle_SOURCES = minglemain.c
+mingle_SOURCES = minglemain.cpp
 mingle_CPPFLAGS = $(AM_CPPFLAGS)
 mingle_LDADD = \
     $(top_builddir)/lib/mingle/libmingle_C.la \
@@ -39,10 +39,6 @@ mingle_LDADD = \
        $(top_builddir)/lib/cdt/libcdt.la \
        $(ANN_LIBS) -lm
 
-# add a non-existent C++ source to force the C++ compiler to be used for
-# linking, so the C++ standard library is included for our C++ dependencies
-nodist_EXTRA_mingle_SOURCES = fake.cxx
-
 if ENABLE_MAN_PDFS
 if HAVE_PS2PDF
 mingle.1.pdf: mingle.1.ps
index d18e2ecc83a19d2a79b8c85b4f1a18161fcc59cc..405f9b2f25fddf91322b108a3520ba73eb5c6ae8 100644 (file)
@@ -99,7 +99,7 @@
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="minglemain.c" />
+    <ClCompile Include="minglemain.cpp" />
   </ItemGroup>
   <ItemGroup>
     <Text Include="ReadMe.txt" />
index 9b4a0e6eb92e3abe6f05059c45d3020e79afa04b..7b875cd82e02c360d675cfe9c20e3e761a623bb4 100644 (file)
@@ -15,7 +15,7 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="minglemain.c">
+    <ClCompile Include="minglemain.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>