From 748a2be14ff8c7563c43b855d444c6b12e9877ea Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Wed, 23 Jul 2008 20:41:19 +0000 Subject: [PATCH] Define sizeof(long) and switch to lib64 for some platforms. --- configure.ac | 1 + xmltooling/util/PathResolver.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 3e22b5a..2edc85e 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ AC_PROG_LIBTOOL # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T +AC_CHECK_SIZEOF([long]) # Checks for library functions. AC_CHECK_FUNCS([strchr strdup strstr timegm strcasecmp]) diff --git a/xmltooling/util/PathResolver.cpp b/xmltooling/util/PathResolver.cpp index f894d2f..f4d4975 100644 --- a/xmltooling/util/PathResolver.cpp +++ b/xmltooling/util/PathResolver.cpp @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Internet2 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,8 +16,8 @@ /** * PathResolver.cpp - * - * Resolves local filenames into absolute pathnames. + * + * Resolves local filenames into absolute pathnames. */ #include "internal.h" @@ -32,9 +32,15 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char* if (!isAbsolute(s.c_str())) { switch (filetype) { case XMLTOOLING_LIB_FILE: - s = string(prefix ? prefix : m_defaultPrefix) + "/lib/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s; + s = string(prefix ? prefix : m_defaultPrefix) + +#if (SIZEOF_LONG == 8) + "/lib64/" +#else + "/lib/" +#endif + + (pkgname ? pkgname : m_defaultPackage) + '/' + s; break; - + case XMLTOOLING_LOG_FILE: if (prefix || m_defaultPrefix != "/usr") s = string(prefix ? prefix : m_defaultPrefix) + "/var/log/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s; @@ -59,7 +65,7 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char* else s = string("/etc/") + (pkgname ? pkgname : m_defaultPackage) + '/' + s; break; - + default: throw XMLToolingException("Unknown file type to resolve."); } -- 2.1.4