Commit 26d74db9 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Modernize assumptions in foundation_util

* Assume building with a macOS SDK newer than 10.8
* Assume C++11 strong enums

This is a partial reland of https://crrev.com/c/2025988. Cronet
for iOS uses base/ and they still support 32-bit iOS versions.

Bug: 1044838
Change-Id: I7c16dfc96228b847a66e4c47de210e147261d52b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028208
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736469}
parent e78e4d7e
......@@ -34,22 +34,12 @@ class UIFont;
#include <ApplicationServices/ApplicationServices.h>
#endif
// Adapted from NSObjCRuntime.h NS_ENUM definition (used in Foundation starting
// with the OS X 10.8 SDK and the iOS 6.0 SDK).
#if __has_extension(cxx_strong_enums) && \
(defined(OS_IOS) || (defined(MAC_OS_X_VERSION_10_8) && \
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8))
#define CR_FORWARD_ENUM(_type, _name) enum _name : _type _name
#else
#define CR_FORWARD_ENUM(_type, _name) _type _name
#endif
// Adapted from NSPathUtilities.h and NSObjCRuntime.h.
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef CR_FORWARD_ENUM(unsigned long, NSSearchPathDirectory);
typedef enum NSSearchPathDirectory : unsigned long NSSearchPathDirectory;
typedef unsigned long NSSearchPathDomainMask;
#else
typedef CR_FORWARD_ENUM(unsigned int, NSSearchPathDirectory);
typedef enum NSSearchPathDirectory : unsigned int NSSearchPathDirectory;
typedef unsigned int NSSearchPathDomainMask;
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment