[haiku-development] Uncertain on this AboutSystem enhancement -- patch inline

  • From: Matt Madia <mattmadia@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 22 Apr 2010 10:21:53 -0400

It's been noted by some that extending AboutSystem to display "GCC # [Hybrid]".
This patch does it, but I don't know if it's a clean solution -- the
two BEntry variables that use absolute paths.
Another concern is that Axel disabled "GCC 2" displaying in r25994,
which is after the introduction of GCC Hybrids in r25536.
Would this be acceptable and OK to commit?

--mmadia



Index: AboutSystem.cpp
===================================================================
--- AboutSystem.cpp     (revision 36387)
+++ AboutSystem.cpp     (working copy)
@@ -492,13 +492,17 @@
                B_ALIGN_VERTICAL_UNSET));

        // GCC version
-#if __GNUC__ != 2
-       snprintf(string, sizeof(string), "GCC %d", __GNUC__);
+       BEntry gccFourHybrid("/boot/system/lib/gcc2/libstdc++.r4.so");
+       BEntry gccTwoHybrid("/boot/system/lib/gcc4/libsupc++.so");
+       if (gccFourHybrid.Exists() || gccTwoHybrid.Exists())
+               snprintf(string, sizeof(string), "GCC %d Hybrid", __GNUC__);
+       else
+               snprintf(string, sizeof(string), "GCC %d", __GNUC__);

+
        BStringView* gccView = new BStringView("gcctext", string);
        gccView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
                B_ALIGN_VERTICAL_UNSET));
-#endif

        // CPU count, type and clock speed
        char processorLabel[256];
@@ -560,9 +564,7 @@
                        .AddGroup(B_VERTICAL)
                                .Add(_CreateLabel("oslabel", TR("Version:")))
                                .Add(versionView)
-#if __GNUC__ != 2
                                .Add(gccView)
-#endif
                                .AddStrut(offset)
                                .Add(_CreateLabel("cpulabel", processorLabel))
                                .Add(cpuView)

Other related posts: