[PATCH] [compiler-rt] Introduce MACOS_VERSION_UNKNOWN_NEWER for OS X versions above 10.10

Justin Bogner mail at justinbogner.com
Mon Dec 15 19:19:34 PST 2014


Kuba Brecka <kuba.brecka at gmail.com> writes:
> We recently had a broken version check because an newer OS X version
> is treated as MACOS_VERSION_UNKNOWN which is less than all the defined
> values. Let's have a separate enum value for unknown but newer
> versions, so the ">=" and "<=" version checks still work even in
> upcoming OS X releases.
>
> http://reviews.llvm.org/D6137
>
> Files:
>   projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
>   projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
>
> Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
> ===================================================================
> --- projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
> +++ projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
> @@ -298,6 +298,11 @@
>          case '2': return MACOS_VERSION_MOUNTAIN_LION;
>          case '3': return MACOS_VERSION_MAVERICKS;
>          case '4': return MACOS_VERSION_YOSEMITE;
> +        case '5':
> +        case '6':
> +        case '7':
> +        case '8':
> +        case '9': return MACOS_VERSION_UNKNOWN_NEWER;
>          default: return MACOS_VERSION_UNKNOWN;

Why not just change the default case to NEWER, since this switch covers
every digit now?

>        }
>      }
> Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
> ===================================================================
> --- projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
> +++ projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
> @@ -27,6 +27,7 @@
>    MACOS_VERSION_MOUNTAIN_LION,
>    MACOS_VERSION_MAVERICKS,
>    MACOS_VERSION_YOSEMITE,
> +  MACOS_VERSION_UNKNOWN_NEWER
>  };
>  
>  MacosVersion GetMacosVersion();
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list