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 /jim.c | |
parent | d3f7c1bc88ff2d8ef0d7417debd0daf5aac810cf (diff) | |
download | jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.zip jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.tar.gz jimtcl-1e9bffb17a4a3ca8e5cd5a62797adbcf6ab71bae.tar.bz2 |
Fix eCos compatiblity problems with autotools.
Diffstat (limited to 'jim.c')
-rw-r--r-- | jim.c | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -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); |