[Libreoffice-commits] .: tools/inc unotools/source

François Tigeot ftigeot at kemper.freedesktop.org
Tue Jun 14 23:25:56 PDT 2011


 tools/inc/tools/inetdef.hxx              |   39 -------------------------------
 unotools/source/config/docinfohelper.cxx |   11 ++++++--
 2 files changed, 8 insertions(+), 42 deletions(-)

New commits:
commit 93cd09347a61a05734f4700df5f6bcfbbeb14054
Author: Francois Tigeot <ftigeot at wolfpond.org>
Date:   Wed Jun 15 00:02:05 2011 +0200

    Remove TOOLS_INETDEF_OS
    
    We don't need yet another unmaintainable platform name macro...

diff --git a/tools/inc/tools/inetdef.hxx b/tools/inc/tools/inetdef.hxx
index 2ba2087..a3407a9 100644
--- a/tools/inc/tools/inetdef.hxx
+++ b/tools/inc/tools/inetdef.hxx
@@ -30,45 +30,6 @@
 #define _TOOLS_INETDEF_HXX
 
 //============================================================================
-#if defined WNT
-#define TOOLS_INETDEF_OS "Win32"
-#elif defined UNX
-#if defined AIX
-#define TOOLS_INETDEF_OS "AIX"
-#elif defined SOLARIS && defined SPARC
-#define TOOLS_INETDEF_OS "Solaris Sparc"
-#elif defined SOLARIS && defined INTEL
-#define TOOLS_INETDEF_OS "Solaris x86"
-#elif defined NETBSD && defined X86
-#define TOOLS_INETDEF_OS "NetBSD/i386"
-#elif defined NETBSD && defined X86_64
-#define TOOLS_INETDEF_OS "NetBSD/amd64"
-#elif defined NETBSD && defined ARM32
-#define TOOLS_INETDEF_OS "NetBSD/arm"
-#elif defined NETBSD && defined SPARC
-#define TOOLS_INETDEF_OS "NetBSD/sparc"
-#elif defined LINUX && defined X86
-#define TOOLS_INETDEF_OS "Linux"
-#elif defined FREEBSD && defined X86
-#define TOOLS_INETDEF_OS "FreeBSD/i386"
-#elif defined FREEBSD && defined X86_64
-#define TOOLS_INETDEF_OS "FreeBSD/amd64"
-#elif defined OPENBSD && defined X86
-#define TOOLS_INETDEF_OS "OpenBSD/i386"
-#elif defined OPENBSD && defined X86_64
-#define TOOLS_INETDEF_OS "OpenBSD/amd64"
-#elif defined DRAGONFLY && defined X86
-#define TOOLS_INETDEF_OS "DragonFly/i386"
-#elif defined DRAGONFLY && defined X86_64
-#define TOOLS_INETDEF_OS "DragonFly/amd64"
-#else // AIX, SOLARIS, ...
-#define TOOLS_INETDEF_OS "Unix"
-#endif // AIX, SOLARIS, ...
-#else // WNT, ...
-#define TOOLS_INETDEF_OS "unknown OS"
-#endif // WN, ...
-
-//============================================================================
 // The following definitions seem obsolete and might get removed in future.
 
 #if defined __RSC
diff --git a/unotools/source/config/docinfohelper.cxx b/unotools/source/config/docinfohelper.cxx
index d2af850..12b7df3 100644
--- a/unotools/source/config/docinfohelper.cxx
+++ b/unotools/source/config/docinfohelper.cxx
@@ -34,6 +34,7 @@
 #include <unotools/configmgr.hxx>
 #include <unotools/bootstrap.hxx>
 #include <unotools/docinfohelper.hxx>
+#include <rtl/bootstrap.hxx>
 
 using namespace ::com::sun::star;
 
@@ -71,10 +72,14 @@ namespace utl
             }
         }
 
+        ::rtl::OUString os( RTL_CONSTASCII_USTRINGPARAM("$_OS") );
+        ::rtl::OUString arch( RTL_CONSTASCII_USTRINGPARAM("$_ARCH") );
+        ::rtl::Bootstrap::expandMacros(os);
+        ::rtl::Bootstrap::expandMacros(arch);
         aResult.append( (sal_Unicode)'$' );
-        aResult.append( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                                TOOLS_INETDEF_OS )).replace( ' ', '_' ) );
-
+        aResult.append( os );
+        aResult.append( (sal_Unicode)'_' );
+        aResult.append( arch );
         aResult.append( (sal_Unicode)' ' );
     }
 


More information about the Libreoffice-commits mailing list