[llvm-commits] [llvm] r80239 - /llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp

Török Edwin edwintorok at gmail.com
Thu Aug 27 05:04:47 PDT 2009


On 2009-08-27 14:54, Sanjiv Gupta wrote:
> Author: sgupta
> Date: Thu Aug 27 06:54:38 2009
> New Revision: 80239
>
> URL: http://llvm.org/viewvc/llvm-project?rev=80239&view=rev
> Log:
> To make mcc16 run correctly on mac.
>
> Modified:
>     llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
>
> Modified: llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp?rev=80239&r1=80238&r2=80239&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp (original)
> +++ llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp Thu Aug 27 06:54:38 2009
> @@ -13,7 +13,7 @@
>  // FIXME: This currently work on linux and windows only. It does not 
>  // work on other unices. 
>  static std::string GetDirSeparator() {
> -#ifdef __linux__
> +#if __linux__ || __APPLE__
>    return "/";
>  #else
>    return "\\";
>   

Since windows is the only one with \\, why not invert the #ifdef?

But System/Path.h already has what you want:

  /// This is the OS-specific path separator: a colon on Unix or a semicolon
  /// on Windows.
  extern const char PathSeparator;

Best regards,
--Edwin



More information about the llvm-commits mailing list