Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: repair the build on Windows #20

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

compnerd
Copy link
Member

Replicate the behaviour from upstream ICU:

#if defined(U_TIMEZONE) || defined(U_HAVE_TIMEZONE)
    /* Use the predefined value. */
#elif U_PLATFORM == U_PF_ANDROID
#   define U_TIMEZONE timezone
#elif defined(__UCLIBC__)
    // uClibc does not have __timezone or _timezone.
#elif defined(_NEWLIB_VERSION)
#   define U_TIMEZONE _timezone
#elif defined(__GLIBC__)
    // glibc
#   define U_TIMEZONE __timezone
#elif U_PLATFORM_IS_LINUX_BASED
    // not defined
#elif U_PLATFORM_USES_ONLY_WIN32_API
#   define U_TIMEZONE _timezone
#elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__)
   /* not defined */
#elif U_PLATFORM == U_PF_OS400
   /* not defined */
#elif U_PLATFORM == U_PF_IPHONE
   /* not defined */
#else
#   define U_TIMEZONE timezone
#endif

With this change, ICU at least builds, but it is unclear if it functions properly on Windows.

@compnerd
Copy link
Member Author

Fixes: #15 (possibly)

Replicate the behaviour from upstream ICU:
  ```
  #if defined(U_TIMEZONE) || defined(U_HAVE_TIMEZONE)
      /* Use the predefined value. */
  #elif U_PLATFORM == U_PF_ANDROID
  #   define U_TIMEZONE timezone
  #elif defined(__UCLIBC__)
      // uClibc does not have __timezone or _timezone.
  #elif defined(_NEWLIB_VERSION)
  #   define U_TIMEZONE _timezone
  #elif defined(__GLIBC__)
      // glibc
  #   define U_TIMEZONE __timezone
  #elif U_PLATFORM_IS_LINUX_BASED
      // not defined
  #elif U_PLATFORM_USES_ONLY_WIN32_API
  #   define U_TIMEZONE _timezone
  #elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__)
     /* not defined */
  #elif U_PLATFORM == U_PF_OS400
     /* not defined */
  #elif U_PLATFORM == U_PF_IPHONE
     /* not defined */
  #else
  #   define U_TIMEZONE timezone
  #endif
  ```

With this change, ICU at least builds, but it is unclear if it functions
properly on Windows.
@iCharlesHu
Copy link
Contributor

Thank you @compnerd !!

@iCharlesHu iCharlesHu merged commit c7ed2ab into swiftlang:main Mar 29, 2024
@compnerd compnerd deleted the timezone branch March 29, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants