Allows edivstd.so te built on non-windows systems

This commit is contained in:
Víctor Román Archidona 2014-07-24 13:02:52 +02:00
parent 4af999b286
commit 59a8f5c6b9
2 changed files with 26 additions and 18 deletions

16
dlls/src/edivstd/build.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
NAME="edivstd"
CCOPTS="-I. -I/usr/local/include -I../include"
FILES="edivstd"
OBJECTS=""
for FILE in $FILES; do
gcc -c $FILE.c $CCOPTS -o $FILE.o
OBJECTS+="$FILE.o "
done
gcc $OBJECTS -shared -o ../../bin/${NAME}.so -L/usr/local/lib -lSDL
rm $OBJECTS

View file

@ -24,14 +24,10 @@
* DIV, tal como las opciones de compilación, estructura reserved, etc.
*/
#ifdef _WIN32
#include <time.h>
#include <sys/timeb.h>
unsigned int tiempo;
unsigned int ultimo_tiempo;
#else
#error ¡adapta las rutinas de timer a Linux! (edivstd no debe usar SDL)
#endif
#include <limits.h>
#include <assert.h>
@ -303,26 +299,22 @@ int eDIV_Let_Me_Alone(FUNCTION_PARAMS)
*/
void first_load(FUNCTION_PARAMS)
{
#ifdef _WIN32
struct timeb tiempob;
ftime(&tiempob);
ultimo_tiempo=tiempob.time*100+tiempob.millitm/10;
#endif
struct timeb tiempob;
ftime(&tiempob);
ultimo_tiempo=tiempob.time*100+tiempob.millitm/10;
}
void frame(FUNCTION_PARAMS)
{
int i;
int timer;
#ifdef _WIN32
struct timeb tiempob;
ftime(&tiempob);
tiempo=tiempob.time*100+tiempob.millitm/10;
timer=globalptr("timer");
for(i=0;i<10;i++)
fp->mem[timer+i]+=tiempo-ultimo_tiempo;
ultimo_tiempo=tiempo;
#endif
struct timeb tiempob;
ftime(&tiempob);
tiempo=tiempob.time*100+tiempob.millitm/10;
timer=globalptr("timer");
for(i=0;i<10;i++)
fp->mem[timer+i]+=tiempo-ultimo_tiempo;
ultimo_tiempo=tiempo;
}