diff --git a/SystemTools.cxx b/SystemTools.cxx
index 0526372a798984631087a6462460ab996ec3ccc4..9b56db066b3e8e664678c0c1bcbe552d9f7b981a 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -523,7 +523,7 @@ void SystemTools::GetPath(std::vector<std::string>& path, const char* env)
     }
 }
 
-const char* SystemTools::GetEnv(const char* key)
+const char* SystemTools::GetEnvImpl(const char* key)
 {
   const char *v = 0;
 #if defined(_WIN32)
@@ -540,9 +540,14 @@ const char* SystemTools::GetEnv(const char* key)
   return v;
 }
 
+const char* SystemTools::GetEnv(const char* key)
+{
+  return SystemTools::GetEnvImpl(key);
+}
+
 const char* SystemTools::GetEnv(const std::string& key)
 {
-  return SystemTools::GetEnv(key.c_str());
+  return SystemTools::GetEnvImpl(key.c_str());
 }
 
 bool SystemTools::GetEnv(const char* key, std::string& result)
diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in
index 8f01e75976cfaa00e489d5911e493b5680935e1d..aa1bf1bfabb2e6d1892ccb7b1f6d6d4b7cc6e3b7 100644
--- a/SystemTools.hxx.in
+++ b/SystemTools.hxx.in
@@ -984,6 +984,7 @@ private:
     std::vector<std::string>(),
     bool no_system_path = false);
 
+  static const char* GetEnvImpl(const char* key);
 
   /**
    * Path translation table from dir to refdir