This fixes the build of dtcm after libcompat was removed in OpenBSD.
>From 537db1c7f6463a4a81884971d8387ae71d969416 Mon Sep 17 00:00:00 2001
From: Pascal Stumpf <pascal.stu...@cubes.de>
Date: Wed, 19 Feb 2014 22:18:56 +0100
Subject: [PATCH] Fix dtcm build on OpenBSD-current.

libcompat and its headers will be gone in the upcoming 5.5 release, so we
cannot use the ftime(3) interface there.  Just fall back to the SVR4 version
of the code for now.
---
 cde/programs/dtcm/dtcm/Imakefile     | 2 +-
 cde/programs/dtcm/libDtCmP/getdate.h | 2 +-
 cde/programs/dtcm/libDtCmP/getdate.y | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cde/programs/dtcm/dtcm/Imakefile b/cde/programs/dtcm/dtcm/Imakefile
index e889c16..971a9bb 100644
--- a/cde/programs/dtcm/dtcm/Imakefile
+++ b/cde/programs/dtcm/dtcm/Imakefile
@@ -32,7 +32,7 @@ EXTRA_LIBRARIES       = -lrpcsvc -lPW -ldiag
 EXTRA_LIBRARIES        = -lrpcsvc -lV3
 #endif
 
-#if defined(BSDArchitecture)
+#if defined(BSDArchitecture) && !defined(OpenBSDArchitecture)
 EXTRA_LIBRARIES = -lcompat
 #endif
 
diff --git a/cde/programs/dtcm/libDtCmP/getdate.h 
b/cde/programs/dtcm/libDtCmP/getdate.h
index fbab931..214750b 100644
--- a/cde/programs/dtcm/libDtCmP/getdate.h
+++ b/cde/programs/dtcm/libDtCmP/getdate.h
@@ -52,7 +52,7 @@
 #ifndef _GETDATE_H
 #define _GETDATE_H
 
-#ifdef USG
+#if defined(USG) || defined(__OpenBSD__)
 struct timeb
 {
         time_t  time;
diff --git a/cde/programs/dtcm/libDtCmP/getdate.y 
b/cde/programs/dtcm/libDtCmP/getdate.y
index e323822..a9ffaf8 100644
--- a/cde/programs/dtcm/libDtCmP/getdate.y
+++ b/cde/programs/dtcm/libDtCmP/getdate.y
@@ -65,8 +65,8 @@ static  char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 
1993 Sun Microsystems
 #define STANDARD 2
 #define MAYBE    3
 
-#ifdef SVR4
-extern long timezone;
+#if defined(SVR4) || defined(__OpenBSD__)
+extern long our_timezone;
 #endif
 
 %}
@@ -528,11 +528,11 @@ time_t cm_getdate(char *p, struct timeb *now)
        lptr = p;
        if (now == ((struct timeb *) NULL)) {
                now = &ftz;
-#ifdef SVR4
+#if defined(SVR4) || defined(__OpenBSD__)
                tod = time(0);
                lt = localtime(&tod);
                now->time = lt->tm_sec;
-               now->timezone = timezone/60;
+               now->timezone = our_timezone/60;
 #else
                ftime(&ftz);
 #endif /* SVR4 */
-- 
1.9.0

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to