Skip to content

Commit

Permalink
applying arrow specific patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Freist committed Jul 11, 2024
1 parent bfe0792 commit 6391021
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
3 changes: 3 additions & 0 deletions cpp/src/arrow/vendored/datetime/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
# pragma warning(disable : 4127)
#endif

namespace arrow_vendored
{
namespace date
{

Expand Down Expand Up @@ -8233,6 +8235,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os,
}

} // namespace date
} // namespace arrow_vendored

#ifdef _MSC_VER
# pragma warning(pop)
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/vendored/datetime/ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
# if TARGET_OS_IPHONE
# include <string>

namespace arrow_vendored
{
namespace date
{
namespace iOSUtils
Expand All @@ -42,6 +44,7 @@

} // namespace iOSUtils
} // namespace date
} // namespace arrow_vendored

# endif // TARGET_OS_IPHONE
#else // !__APPLE__
Expand Down
5 changes: 4 additions & 1 deletion cpp/src/arrow/vendored/datetime/ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// SOFTWARE.
//

#include "date/ios.h"
#include "ios.h"

#if TARGET_OS_IPHONE

Expand All @@ -47,6 +47,8 @@
#define TAR_SIZE_POSITION 124
#define TAR_SIZE_SIZE 12

namespace arrow_vendored
{
namespace date
{
namespace iOSUtils
Expand Down Expand Up @@ -333,5 +335,6 @@ bool writeFile(const std::string &tzdataPath, const std::string &fileName,

} // namespace iOSUtils
} // namespace date
} // namespace arrow_vendored

#endif // TARGET_OS_IPHONE
14 changes: 10 additions & 4 deletions cpp/src/arrow/vendored/datetime/tz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
// been invented (that would involve another several millennia of evolution).
// We did not mean to shout.

// NOTE(ARROW): This is required so that symbols are properly exported from the DLL
#include "visibility.h"


#ifdef _WIN32
// windows.h will be included directly and indirectly (e.g. by curl).
// We need to define these macros to prevent windows.h bringing in
Expand Down Expand Up @@ -83,10 +87,10 @@
# include <windows.h>
#endif // _WIN32

#include "date/tz_private.h"
#include "tz_private.h"

#ifdef __APPLE__
# include "date/ios.h"
# include "ios.h"
#else
# define TARGET_OS_IPHONE 0
# define TARGET_OS_SIMULATOR 0
Expand Down Expand Up @@ -118,7 +122,7 @@
#include <vector>
#include <sys/stat.h>

// unistd.h is used on some platforms as part of the the means to get
// unistd.h is used on some platforms as part of the means to get
// the current time zone. On Win32 windows.h provides a means to do it.
// gcc/mingw supports unistd.h on Win32 but MSVC does not.

Expand Down Expand Up @@ -384,7 +388,8 @@ class file_streambuf
};

#endif // !USE_OS_TZDB

namespace arrow_vendored
{
namespace date
{
// +---------------------+
Expand Down Expand Up @@ -4142,6 +4147,7 @@ current_zone()
}

} // namespace date
} // namespace arrow_vendored

#if defined(__GNUC__) && __GNUC__ < 5
# pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions cpp/src/arrow/vendored/datetime/tz.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
// required. On Windows, the names are never "Standard" so mapping is always required.
// Technically any OS may use the mapping process but currently only Windows does use it.

// NOTE(ARROW): If this is not set, then the library will attempt to
// use libcurl to obtain a timezone database, and we probably do not want this.
#ifndef _WIN32
#define USE_OS_TZDB 1
#endif

#ifndef USE_OS_TZDB
# define USE_OS_TZDB 0
#endif
Expand Down Expand Up @@ -134,6 +140,8 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true,
# endif
#endif

namespace arrow_vendored
{
namespace date
{

Expand Down Expand Up @@ -2788,5 +2796,6 @@ to_gps_time(const tai_time<Duration>& t)
}

} // namespace date
} // namespace arrow_vendored

#endif // TZ_H
3 changes: 3 additions & 0 deletions cpp/src/arrow/vendored/datetime/tz_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <vector>
#endif

namespace arrow_vendored
{
namespace date
{

Expand Down Expand Up @@ -307,6 +309,7 @@ struct transition
} // namespace detail

} // namespace date
} // namespace arrow_vendored

#if defined(_MSC_VER) && (_MSC_VER < 1900)
#include "tz.h"
Expand Down

0 comments on commit 6391021

Please sign in to comment.