diff options
author | oyvind <oyvind@titan.(none)> | 2009-10-19 15:18:08 +0200 |
---|---|---|
committer | oyvind <oyvind@titan.(none)> | 2009-10-19 15:18:08 +0200 |
commit | 1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae (patch) | |
tree | 96d8225e7b47d8a8138164e0cbd9db7de66f546a | |
parent | d3f7c1bc88ff2d8ef0d7417debd0daf5aac810cf (diff) | |
download | jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.zip jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.tar.gz jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.tar.bz2 |
Fix eCos compatiblity problems with autotools.
-rw-r--r-- | ecos/language/tcl/jim/current/include/jim-eventloop.h | 47 | ||||
-rw-r--r-- | ecos/language/tcl/jim/current/include/jim.h | 6 | ||||
-rw-r--r-- | ecos/language/tcl/jim/current/src/jim-eventloop.c | 77 | ||||
-rw-r--r-- | ecos/language/tcl/jim/current/src/jim.c | 30 | ||||
-rw-r--r-- | jim-eventloop.c | 5 | ||||
-rw-r--r-- | jim.c | 30 | ||||
-rw-r--r-- | jim.h | 6 |
7 files changed, 95 insertions, 106 deletions
diff --git a/ecos/language/tcl/jim/current/include/jim-eventloop.h b/ecos/language/tcl/jim/current/include/jim-eventloop.h index e09170e..ddb6fc9 100644 --- a/ecos/language/tcl/jim/current/include/jim-eventloop.h +++ b/ecos/language/tcl/jim/current/include/jim-eventloop.h @@ -2,25 +2,25 @@ * * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> - * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> + * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -33,7 +33,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -63,18 +63,16 @@ typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); #define JIM_EVENT_EXCEPTION 4 #define JIM_EVENT_FEOF 8 -#ifndef __JIM_EVENTLOOP_CORE__ -# if defined JIM_EXTENSION || defined JIM_EMBEDDED -# define JIM_API(x) (*x) -# define JIM_STATIC -# else -# define JIM_API(x) (*x) -# define JIM_STATIC extern -# endif -#else -# define JIM_API(x) x -# define JIM_STATIC static -#endif /* __JIM_EVENTLOOP_CORE__ */ +#define JIM_API(x) x +#define JIM_STATIC + +JIM_STATIC int Jim_EventLoopOnLoad(Jim_Interp *interp); + +/* --- POSIX version of Jim_ProcessEvents, for now the only available --- */ +#define JIM_FILE_EVENTS 1 +#define JIM_TIME_EVENTS 2 +#define JIM_ALL_EVENTS (JIM_FILE_EVENTS | JIM_TIME_EVENTS) +#define JIM_DONT_WAIT 4 JIM_STATIC void JIM_API(Jim_CreateFileHandler) (Jim_Interp *interp, void *handle, int mask, @@ -97,17 +95,6 @@ JIM_STATIC int JIM_API(Jim_ProcessEvents) (Jim_Interp *interp, int flags); #define JIM_GET_API(name) \ Jim_GetApi(interp, "Jim_" #name, ((void *)&Jim_ ## name)) -#if defined(JIM_EXTENSION) || defined(JIM_EMBEDDED) -/* This must be included "inline" inside the extension */ -static void Jim_ImportEventloopAPI(Jim_Interp *interp) -{ - JIM_GET_API(CreateFileHandler); - JIM_GET_API(DeleteFileHandler); - JIM_GET_API(CreateTimeHandler); - JIM_GET_API(DeleteTimeHandler); - JIM_GET_API(ProcessEvents); -} -#endif /* defined JIM_EXTENSION || defined JIM_EMBEDDED */ #undef JIM_GET_API #endif /* __JIM_EVENTLOOP_CORE__ */ diff --git a/ecos/language/tcl/jim/current/include/jim.h b/ecos/language/tcl/jim/current/include/jim.h index 82d987f..089ccc1 100644 --- a/ecos/language/tcl/jim/current/include/jim.h +++ b/ecos/language/tcl/jim/current/include/jim.h @@ -87,7 +87,7 @@ extern "C" { #endif /* _MSC_VER */ /* Long Long type and related issues */ -#ifdef HAVE_LONG_LONG_INT +#if !defined(__ECOS) && defined(HAVE_LONG_LONG_INT) # ifdef _MSC_VER /* MSC compiler */ # define jim_wide _int64 # ifndef LLONG_MAX @@ -119,8 +119,8 @@ extern "C" { * LIBC specific fixes * ---------------------------------------------------------------------------*/ -#ifdef HAVE_LONG_LONG_INT -# if defined(_MSC_VER) || defined(__MSVCRT__) +#if !defined(__ECOS) && defined(HAVE_LONG_LONG_INT) +# if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__MINGW32__) # define JIM_WIDE_MODIFIER "I64d" # else # define JIM_WIDE_MODIFIER "lld" diff --git a/ecos/language/tcl/jim/current/src/jim-eventloop.c b/ecos/language/tcl/jim/current/src/jim-eventloop.c index 2dbb47c..fae46e8 100644 --- a/ecos/language/tcl/jim/current/src/jim-eventloop.c +++ b/ecos/language/tcl/jim/current/src/jim-eventloop.c @@ -2,25 +2,25 @@ * * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> - * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> + * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -33,7 +33,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -44,13 +44,15 @@ * - more complete [after] command with [after info] and other subcommands. * - Win32 port */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #define JIM_EXTENSION #define __JIM_EVENTLOOP_CORE__ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifdef __ECOS +#include <sys/time.h> #include <cyg/jimtcl/jim.h> #include <cyg/jimtcl/jim-eventloop.h> #else @@ -58,19 +60,10 @@ #include "jim-eventloop.h" #endif -/* POSIX includes */ -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/select.h> -#include <errno.h> - extern int errno; -/* --- */ - /* File event structure */ typedef struct Jim_FileEvent { void *handle; - int mask; /* one of JIM_EVENT_(READABLE|WRITABLE|EXCEPTION) */ + int mask; /* one of JIM_EVENT_(READABLE | WRITABLE | EXCEPTION) */ Jim_FileProc *fileProc; Jim_EventFinalizerProc *finalizerProc; void *clientData; @@ -122,7 +115,7 @@ void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop"); fe = eventLoop->fileEventHead; - while(fe) { + while (fe) { if (fe->handle == handle) { if (prev == NULL) eventLoop->fileEventHead = fe->next; @@ -139,12 +132,12 @@ void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) } // The same for signals. -void Jim_CreateSignalHandler(Jim_Interp *interp, int signum, +void Jim_CreateSignalHandler(Jim_Interp *interp, int signum, Jim_FileProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc) { } -void Jim_DeleteSignalHandler(Jim_Interp *interp, int signum) +void Jim_DeleteSignalHandler(Jim_Interp *interp, int signum) { } @@ -198,9 +191,9 @@ jim_wide Jim_DeleteTimeHandler(Jim_Interp *interp, jim_wide id) JimGetTime(&cur_sec, &cur_ms); te = eventLoop->timeEventHead; - if (id >= eventLoop->timeEventNextId) + if (id >= eventLoop->timeEventNextId) return -2; /* wrong event ID */ - while(te) { + while (te) { if (te->id == id) { remain = (te->when_sec - cur_sec) * 1000; remain += (te->when_ms - cur_ms) ; @@ -230,7 +223,7 @@ static Jim_TimeEvent *JimSearchNearestTimer(Jim_EventLoop *eventLoop) Jim_TimeEvent *te = eventLoop->timeEventHead; Jim_TimeEvent *nearest = NULL; - while(te) { + while (te) { if (!nearest || te->when_sec < nearest->when_sec || (te->when_sec == nearest->when_sec && te->when_ms < nearest->when_ms)) @@ -243,7 +236,7 @@ static Jim_TimeEvent *JimSearchNearestTimer(Jim_EventLoop *eventLoop) /* --- POSIX version of Jim_ProcessEvents, for now the only available --- */ #define JIM_FILE_EVENTS 1 #define JIM_TIME_EVENTS 2 -#define JIM_ALL_EVENTS (JIM_FILE_EVENTS|JIM_TIME_EVENTS) +#define JIM_ALL_EVENTS (JIM_FILE_EVENTS | JIM_TIME_EVENTS) #define JIM_DONT_WAIT 4 /* Process every pending time event, then every pending file event @@ -275,9 +268,9 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) /* Check file events */ while (fe != NULL) { - int fd = fileno(fe->handle); + int fd = fileno((FILE*)fe->handle); - if (fe->mask & JIM_EVENT_READABLE) + if (fe->mask & JIM_EVENT_READABLE) FD_SET(fd, &rfds); if (fe->mask & JIM_EVENT_WRITABLE) FD_SET(fd, &wfds); if (fe->mask & JIM_EVENT_EXCEPTION) FD_SET(fd, &efds); @@ -304,7 +297,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) JimGetTime(&now_sec, &now_ms); tvp = &tv; dt = 1000 * (shortest->when_sec - now_sec); - dt += ( shortest->when_ms - now_ms); + dt += (shortest->when_ms - now_ms); if (dt < 0) { dt = 1; } @@ -316,7 +309,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) // fprintf(stderr,"No Event\n"); } - retval = select(maxfd+1, &rfds, &wfds, &efds, tvp); + retval = select(maxfd + 1, &rfds, &wfds, &efds, tvp); if (retval < 0) { switch (errno) { case EINTR: fprintf(stderr,"select EINTR\n"); break; @@ -325,8 +318,8 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) } } else if (retval > 0) { fe = eventLoop->fileEventHead; - while(fe != NULL) { - int fd = fileno(fe->handle); + while (fe != NULL) { + int fd = fileno((FILE*)fe->handle); // fprintf(stderr,"fd: %d mask: %02x \n",fd,fe->mask); @@ -338,7 +331,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) if (fe->mask & JIM_EVENT_READABLE && FD_ISSET(fd, &rfds)) { mask |= JIM_EVENT_READABLE; - if ((fe->mask & JIM_EVENT_FEOF) && feof(fe->handle)) + if ((fe->mask & JIM_EVENT_FEOF) && feof((FILE *)fe->handle)) mask |= JIM_EVENT_FEOF; } if (fe->mask & JIM_EVENT_WRITABLE && FD_ISSET(fd, &wfds)) @@ -367,7 +360,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) /* Check time events */ te = eventLoop->timeEventHead; maxId = eventLoop->timeEventNextId-1; - while(te) { + while (te) { long now_sec, now_ms; jim_wide id; @@ -406,7 +399,7 @@ void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) Jim_EventLoop *eventLoop = data; fe = eventLoop->fileEventHead; - while(fe) { + while (fe) { next = fe->next; if (fe->finalizerProc) fe->finalizerProc(interp, fe->clientData); @@ -415,7 +408,7 @@ void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) } te = eventLoop->timeEventHead; - while(te) { + while (te) { next = te->next; if (te->finalizerProc) te->finalizerProc(interp, te->clientData); @@ -425,7 +418,7 @@ void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) Jim_Free(data); } -static int JimELVwaitCommand(Jim_Interp *interp, int argc, +static int JimELVwaitCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *oldValue; @@ -467,7 +460,7 @@ void JimAfterTimeEventFinalizer(Jim_Interp *interp, void *clientData) Jim_DecrRefCount(interp, objPtr); } -static int JimELAfterCommand(Jim_Interp *interp, int argc, +static int JimELAfterCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_wide ms, id; @@ -504,7 +497,7 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc, int tlen ; jim_wide remain = 0; const char *tok = Jim_GetString(argv[2], &tlen); - if ( sscanf(tok,"after#%lld",&id) == 1) { + if (sscanf(tok,"after#%" JIM_WIDE_MODIFIER, &id) == 1) { remain = Jim_DeleteTimeHandler(interp, id); if (remain > -2) { Jim_SetResult(interp, Jim_NewIntObj(interp, remain)); @@ -516,11 +509,13 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc, } default: fprintf(stderr,"unserviced option to after %d\n",option); - } + } return JIM_OK; } -int Jim_OnLoad(Jim_Interp *interp) +/* This extension is not dynamically loaded, instead it's linked statically, + which is why we shouldn't use the unspecific 'Jim_OnLoad' name */ +int Jim_EventLoopOnLoad(Jim_Interp *interp) { Jim_EventLoop *eventLoop; diff --git a/ecos/language/tcl/jim/current/src/jim.c b/ecos/language/tcl/jim/current/src/jim.c index 8575783..117ec56 100644 --- a/ecos/language/tcl/jim/current/src/jim.c +++ b/ecos/language/tcl/jim/current/src/jim.c @@ -3,11 +3,14 @@ * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2008,2009 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> * Copyright 2008 Steve Bennett <steveb@workware.net.au> + * Copyright 2009 Nico Coesel <ncoesel@dealogic.nl> + * Copyright 2009 Zachary T Welch zw@superlucidity.net + * Copyright 2009 David Brownell * * The FreeBSD license * @@ -48,13 +51,11 @@ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifndef JIM_ANSIC -#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ -#endif /* JIM_ANSIC */ - #include <stdio.h> #include <stdlib.h> + +typedef CYG_ADDRWORD intptr_t; + #include <string.h> #include <stdarg.h> #include <ctype.h> @@ -62,6 +63,13 @@ #include <assert.h> #include <errno.h> #include <time.h> +#endif +#ifndef JIM_ANSIC +#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ +#endif /* JIM_ANSIC */ + +#include <stdarg.h> +#include <limits.h> /* Include the platform dependent libraries for * dynamic loading of libraries. */ @@ -83,10 +91,6 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 -#include <unistd.h> -#endif - #ifdef __ECOS #include <cyg/jimtcl/jim.h> #else @@ -4753,7 +4757,7 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) Jim_AddHashEntry(&interp->sharedStrings, strCopy, (void*)1); return strCopy; } else { - long refCount = (long) he->val; + intptr_t refCount = (intptr_t) he->val; refCount++; he->val = (void*) refCount; @@ -4763,13 +4767,13 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) void Jim_ReleaseSharedString(Jim_Interp *interp, const char *str) { - long refCount; + intptr_t refCount; Jim_HashEntry *he = Jim_FindHashEntry(&interp->sharedStrings, str); if (he == NULL) Jim_Panic(interp,"Jim_ReleaseSharedString called with " "unknown shared string '%s'", str); - refCount = (long) he->val; + refCount = (intptr_t) he->val; refCount--; if (refCount == 0) { Jim_DeleteHashEntry(&interp->sharedStrings, str); diff --git a/jim-eventloop.c b/jim-eventloop.c index 5da00c9..fae46e8 100644 --- a/jim-eventloop.c +++ b/jim-eventloop.c @@ -52,8 +52,7 @@ #define __JIM_EVENTLOOP_CORE__ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifdef __ECOS +#include <sys/time.h> #include <cyg/jimtcl/jim.h> #include <cyg/jimtcl/jim-eventloop.h> #else @@ -498,7 +497,7 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc, int tlen ; jim_wide remain = 0; const char *tok = Jim_GetString(argv[2], &tlen); - if (sscanf(tok,"after#%lld",&id) == 1) { + if (sscanf(tok,"after#%" JIM_WIDE_MODIFIER, &id) == 1) { remain = Jim_DeleteTimeHandler(interp, id); if (remain > -2) { Jim_SetResult(interp, Jim_NewIntObj(interp, remain)); @@ -3,11 +3,14 @@ * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2008,2009 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> * Copyright 2008 Steve Bennett <steveb@workware.net.au> + * Copyright 2009 Nico Coesel <ncoesel@dealogic.nl> + * Copyright 2009 Zachary T Welch zw@superlucidity.net + * Copyright 2009 David Brownell * * The FreeBSD license * @@ -48,13 +51,11 @@ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifndef JIM_ANSIC -#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ -#endif /* JIM_ANSIC */ - #include <stdio.h> #include <stdlib.h> + +typedef CYG_ADDRWORD intptr_t; + #include <string.h> #include <stdarg.h> #include <ctype.h> @@ -62,6 +63,13 @@ #include <assert.h> #include <errno.h> #include <time.h> +#endif +#ifndef JIM_ANSIC +#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ +#endif /* JIM_ANSIC */ + +#include <stdarg.h> +#include <limits.h> /* Include the platform dependent libraries for * dynamic loading of libraries. */ @@ -83,10 +91,6 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 -#include <unistd.h> -#endif - #ifdef __ECOS #include <cyg/jimtcl/jim.h> #else @@ -4753,7 +4757,7 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) Jim_AddHashEntry(&interp->sharedStrings, strCopy, (void*)1); return strCopy; } else { - long refCount = (long) he->val; + intptr_t refCount = (intptr_t) he->val; refCount++; he->val = (void*) refCount; @@ -4763,13 +4767,13 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) void Jim_ReleaseSharedString(Jim_Interp *interp, const char *str) { - long refCount; + intptr_t refCount; Jim_HashEntry *he = Jim_FindHashEntry(&interp->sharedStrings, str); if (he == NULL) Jim_Panic(interp,"Jim_ReleaseSharedString called with " "unknown shared string '%s'", str); - refCount = (long) he->val; + refCount = (intptr_t) he->val; refCount--; if (refCount == 0) { Jim_DeleteHashEntry(&interp->sharedStrings, str); @@ -87,7 +87,7 @@ extern "C" { #endif /* _MSC_VER */ /* Long Long type and related issues */ -#ifdef HAVE_LONG_LONG_INT +#if !defined(__ECOS) && defined(HAVE_LONG_LONG_INT) # ifdef _MSC_VER /* MSC compiler */ # define jim_wide _int64 # ifndef LLONG_MAX @@ -119,8 +119,8 @@ extern "C" { * LIBC specific fixes * ---------------------------------------------------------------------------*/ -#ifdef HAVE_LONG_LONG_INT -# if defined(_MSC_VER) || defined(__MSVCRT__) +#if !defined(__ECOS) && defined(HAVE_LONG_LONG_INT) +# if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__MINGW32__) # define JIM_WIDE_MODIFIER "I64d" # else # define JIM_WIDE_MODIFIER "lld" |