From 8350ba19db72adfbb7367df2511dfdb95894a402 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 25 Jul 2007 03:49:31 +0000 Subject: [PATCH] Add protections against the shlwapi.h header file. This commit was SVN r15597. --- configure.ac | 2 +- opal/util/path.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a5359e06c7..50c3b8f8fc 100644 --- a/configure.ac +++ b/configure.ac @@ -596,7 +596,7 @@ AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \ sys/types.h sys/uio.h net/uio.h sys/utsname.h sys/wait.h syslog.h \ time.h termios.h ulimit.h unistd.h util.h utmp.h malloc.h \ ifaddrs.h sys/sysctl.h crt_externs.h regex.h \ - ioLib.h sockLib.h hostLib.h]) + ioLib.h sockLib.h hostLib.h shlwapi.h]) # Needed to work around Darwin requiring sys/socket.h for # net/if.h diff --git a/opal/util/path.c b/opal/util/path.c index ecd427b195..ecd977e5e4 100644 --- a/opal/util/path.c +++ b/opal/util/path.c @@ -22,9 +22,9 @@ #ifdef HAVE_UNISTD_H #include #endif -#if defined(__WINDOWS__) +#ifdef HAVE_SHLWAPI_H #include -#endif /* defined(__WINDOWS__) */ +#endif #include "opal/util/path.h" #include "opal/util/os_path.h" @@ -307,7 +307,9 @@ char* opal_find_absolute_path( char* app_name ) #if !defined(__WINDOWS__) realpath( abs_app_name, resolved_path ); #else +#ifdef HAVE_SHLWAPI_H PathCanonicalize(resolved_path, abs_app_name); +#endif #endif /* !defined(__WINDOWS__) */ if( abs_app_name != app_name ) free(abs_app_name); return strdup(resolved_path);