freebsd-ports/audio/rezound/files/patch-src_misc_clocks.cpp
Alexey Dokuchaev 44b1e2aafe - Resurrect `audio/rezound' as the days of gcc/libstdc++ mess are gone
(at least on tier-1 architectures)
- Update to version 0.13.1beta which includes many C++ related fixes
  (unfortunately, a number of issues still remain to be patched)
- Let the compiler handle template instantiation of ``TPoolFile'' [1]
- Use native atomics instead of pulling Boost header
- Convert few remaining sed(1) in-place editing to patch files
- Bump FOX toolkit version being used (1.4 -> 1.6)
- Get rid of absolute port origins when specifying dependencies
- Unbreak NLS option (and enable it back by default)

[1] http://bugs.gentoo.org/334797
2017-03-03 16:22:28 +00:00

23 lines
764 B
C++

--- src/misc/clocks.cpp.orig 2013-02-10 06:35:02 UTC
+++ src/misc/clocks.cpp
@@ -304,18 +304,8 @@ int get_timezone_offset()
#ifdef __APPLE__
int ret = [[NSTimeZone localTimeZone] secondsFromGMT];
#else
- tzset();
-
- // ::timezone's manpage says "Seconds West of GMT", but I found this not to be the case
- // ::timezone is in the range [-12*3600, 12*3600], but it's sign is opposite what we expect:
- // Central Time is +6 hours
- // We want to return -6 hours for Central, so we translate the range and ensure it's min and max value
-
-
- int ret = ::timezone;
-
- // invert sign for our purposes
- ret = -ret;
+ time_t date = time(NULL);
+ int ret = localtime(&date)->tm_gmtoff;
#endif
// "clamp-and-shift" to convert values outside the appropriate