pkgsrc/comms/plptools/patches/patch-ai
joerg caa939db59 Add DragonFly support.
Fix C++ RTL usage: c_str is how to get the representation, not getCStr.
Attempt to fix declaration of static template members. Be conditional
for GCC 3.4+ for now, it conflicts with the constructor in GCC 3.3.
Attempt to fix timezone usage as found in other packages.
Use PTHREAD_* variables instead of hard-coded -lpthread.
Don't look for _nl_domain_bindings in -lintl, libintl uses a different
prefix.
Remove harmfull class keywords in friend declarations.
2006-02-02 15:03:19 +00:00

37 lines
1.1 KiB
Text

$NetBSD: patch-ai,v 1.3 2006/02/02 15:03:19 joerg Exp $
--- lib/psitime.cc.orig 2002-08-05 11:27:54.000000000 +0000
+++ lib/psitime.cc
@@ -63,7 +63,7 @@ PsiTime::PsiTime(const u_int32_t _ptvHi,
psi2unix();
}
-PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz = 0L) {
+PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz) {
if (_utv != 0L)
utv = *_utv;
if (_utz != 0L)
@@ -219,7 +219,11 @@ evalOffset(psi_timezone ptz, time_t time
* daylight saving.
*/
struct tm *tm = localtime(&time);
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
+ offset = -tm->tm_gmtoff;
+#else
offset = timezone;
+#endif
if (tm->tm_isdst)
offset += 3600;
}
@@ -228,7 +232,11 @@ evalOffset(psi_timezone ptz, time_t time
// later
time_t now = ::time(0);
struct tm *now_tm = localtime(&now);
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
+ offset -= -now_tm->tm_gmtoff;
+#else
offset -= timezone;
+#endif
offset *= 1000000;
return offset;