replace ftime() with gettimeofday() and drop -lcompat; ok edd@ jca@

This commit is contained in:
naddy 2013-12-02 16:32:12 +00:00
parent 80546a87fd
commit 54e1152622
3 changed files with 54 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.13 2013/09/10 10:23:34 edd Exp $
# $OpenBSD: Makefile,v 1.14 2013/12/02 16:32:12 naddy Exp $
BROKEN-powerpc = error: invalid 'asm': invalid %k value
BROKEN-alpha = error: invalid 'asm': invalid %xn code
@ -6,7 +6,7 @@ BROKEN-sparc64 = error: invalid 'asm': invalid operand output code
COMMENT = modern Amiga emulator
V = 2.2.3
REVISION = 0
REVISION = 1
MODPY_EGG_VERSION = ${V}
DISTNAME = fs-uae-$V
CATEGORIES = emulators

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-Makefile,v 1.3 2013/09/10 10:23:35 edd Exp $
$OpenBSD: patch-Makefile,v 1.4 2013/12/02 16:32:12 naddy Exp $
Disable custom optimisation flags.
--- Makefile.orig Sun Mar 24 23:49:51 2013
+++ Makefile Sun Mar 24 23:50:00 2013
--- Makefile.orig Tue Jun 25 21:21:16 2013
+++ Makefile Sun Dec 1 23:43:29 2013
@@ -88,14 +88,6 @@ endif
profile_generate := 0
profile_use := 0
@ -19,3 +19,12 @@ Disable custom optimisation flags.
ifeq ($(profile_generate), 1)
cflags += -fprofile-generate
cxxflags += -fprofile-generate
@@ -154,7 +146,7 @@ else ifeq ($(os), freebsd)
libs += -lGL -lGLU -lopenal -lX11 -lcompat
else ifeq ($(os), openbsd)
cppflags += -DOPENBSD
- libs += -lGL -lGLU -lopenal -lX11 -lcompat
+ libs += -lGL -lGLU -lopenal -lX11
else
cppflags += -DLINUX
ldflags += -Wa,--execstack

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-src_blkdev_cdimage_cpp,v 1.1 2013/12/02 16:32:12 naddy Exp $
Replace ftime() by gettimeofday().
--- src/blkdev_cdimage.cpp.orig Tue Jun 25 21:21:17 2013
+++ src/blkdev_cdimage.cpp Sun Dec 1 23:41:31 2013
@@ -13,7 +13,7 @@
#include "sysconfig.h"
#include "sysdeps.h"
-#include <sys/timeb.h>
+#include <sys/time.h>
#include "options.h"
#include "blkdev.h"
@@ -375,11 +375,11 @@ static void *cdda_play_func (void *v)
if (oldplay != cdu->cdda_play) {
struct cdtoc *t;
int sector, diff;
- struct _timeb tb1, tb2;
+ struct timeval tb1, tb2;
idleframes = 0;
foundsub = false;
- _ftime (&tb1);
+ gettimeofday (&tb1, NULL);
cdda_pos = cdu->cdda_start;
oldplay = cdu->cdda_play;
sector = cdu->cd_last_pos = cdda_pos;
@@ -434,8 +434,8 @@ static void *cdda_play_func (void *v)
}
cdda_pos -= idleframes;
- _ftime (&tb2);
- diff = (tb2.time * (uae_s64)1000 + tb2.millitm) - (tb1.time * (uae_s64)1000 + tb1.millitm);
+ gettimeofday (&tb2, NULL);
+ diff = (tb2.tv_sec * (uae_s64)1000 + tb2.tv_usec / 1000) - (tb1.tv_sec * (uae_s64)1000 + tb1.tv_usec / 1000);
diff -= cdu->cdda_delay;
if (idleframes >= 0 && diff < 0 && cdu->cdda_play > 0)
Sleep (-diff);