AzureAD / azure-activedirectory-library-for-objc

The ADAL SDK for Objective C gives you the ability to add support for Work Accounts to your iOS and macOS applications with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.
MIT License
177 stars 113 forks source link

HTTP_UNAUTHORIZED XCode 14+ build fix #1596

Closed mipetriu closed 1 year ago

mipetriu commented 1 year ago

In the most recent MacOS/Xcode, it seems that the following line has been added in http.h from the MacOS system code: # define HTTP_UNAUTHORIZED HTTP_STATUS_UNAUTHORIZED

This seems to set both enum names to the same error code:

HTTP_STATUS_BAD_REQUEST = 400,  /* Bad request */
HTTP_STATUS_UNAUTHORIZED,       /* Unauthorized to access host */

We define HTTP_UNAUTHORIZED as the error code 401 within our own code. Based on the above, this PR removes that definition if the code is built from XCode 14+ where the definition already exists.