From 2dd1b5e3b3113dd30336ebcc069588944dec580d Mon Sep 17 00:00:00 2001 From: deflected Date: Fri, 20 Feb 2015 11:58:28 +0200 Subject: [PATCH 1/2] dtool: Fixed building under FreeBSD There is missing define in dtoolutil which prevent building of dtool under FreeBSD. Signed-off-by: deflected --- dtool/src/dtoolutil/executionEnvironment.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 059bce8fcd..3f06a3427f 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -60,7 +60,7 @@ extern char **environ; #include #endif -#if defined(IS_LINUX) || defined(IS_OSX) +#if defined(IS_LINUX) || defined(IS_OSX) || defined(IS_FREEBSD) // For link_map and dlinfo. #include #include From d82f2c83cdf81b3cd45e1c61a335d439f11805be Mon Sep 17 00:00:00 2001 From: deflected Date: Fri, 20 Feb 2015 13:59:35 +0200 Subject: [PATCH 2/2] downloader: Correct lack of timezone - Use tm_gmtoff for GMT correction under FreeBSD Signed-off-by: deflected --- panda/src/downloader/httpDate.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index fd9d01e8ed..ea143e0bfa 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -223,8 +223,14 @@ HTTPDate(const string &format) { if (_time != (time_t)-1) { // Unfortunately, mktime() assumes local time; convert this back // to GMT. +#ifdef IS_FREEBSD + time_t now = time(NULL); + struct tm *tp = localtime(&now); + _time -= tp->tm_gmtoff; +#else /* IS_FREEBSD */ extern long int timezone; _time -= timezone; +#endif /* IS_FREEBSD */ } #endif // __GNUC__ }