#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
+\r
+#include <sys/types.h>\r
+#include <sys/stat.h>\r
#include <unistd.h>\r
\r
#define STATIC static\r
//printf("-%s\n",resdir);\r
if (stat(resdir,&fst)) continue;\r
//printf("--mode %x\n",fst.st_mode);\r
- if (fst.st_mode & S_IFDIR)\r
+ if (S_ISDIR(fst.st_mode))\r
addentry(p,&dirs);\r
else\r
{\r
void *trace[16];
char *nam;
int i, trace_size = 0;
- ucontext_t *uc = (ucontext_t *)secret;
+// ucontext_t *uc = (ucontext_t *)secret;
if (sig == SIGINT)
os_fatal("Emergency exit!\n\n(Signal SIGINT received)");
printf("\nInterpreter bug!\nSignal %d ", sig);
if ((nam = getsigname(sig))) printf("[%s] ",nam);
- printf("from %p", (void *)uc->uc_mcontext.gregs[_PROG_COUNTER]);
+// printf("from %p", (void *)uc->uc_mcontext.gregs[_PROG_COUNTER]);
if (sig == SIGSEGV)
printf(" [faulty address is %p]",info->si_addr);
trace_size = backtrace(trace, 16);
/* overwrite sigaction with caller's address */
- trace[1] = (void *) uc->uc_mcontext.gregs[_PROG_COUNTER];
+// trace[1] = (void *) uc->uc_mcontext.gregs[_PROG_COUNTER];
/* skip first stack frame (points here) */
printf("Backtrace:\n");
#include <libgen.h>
+#include <SDL.h>
#include <zlib.h>
#ifdef __WIN32__
#include <sys/time.h>
#endif
-#ifdef WIN32
+void sf_sleep( int msecs)
+{
+ SDL_Delay(msecs);
+}
-void sf_sleep( int msecs){
- Sleep(msecs);
- }
+#ifdef WIN32
unsigned long sf_ticks( void){
return (GetTickCount());
#else
-//#include <unistd.h>
-
-void sf_sleep( int msecs){
- usleep(msecs/1000);
- }
-
unsigned long sf_ticks (void) {
struct timeval now;
static struct timeval start;