diff options
author | oyvind <oyvind@titan.(none)> | 2009-10-19 15:18:08 +0200 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:37 +1000 |
commit | e370d3d50f3fa02dc9b3fe13a2456dcb232a99d6 (patch) | |
tree | 889c3c0a8028a034e88a2c9357c8f1728e763e8d /jim.c | |
parent | 2a219122c883585f7d62268a512b9c11f9373fee (diff) | |
download | jimtcl-e370d3d50f3fa02dc9b3fe13a2456dcb232a99d6.zip jimtcl-e370d3d50f3fa02dc9b3fe13a2456dcb232a99d6.tar.gz jimtcl-e370d3d50f3fa02dc9b3fe13a2456dcb232a99d6.tar.bz2 |
Fix eCos compatiblity problems with autotools.
Diffstat (limited to 'jim.c')
-rw-r--r-- | jim.c | 34 |
1 files changed, 19 insertions, 15 deletions
@@ -2,13 +2,16 @@ * * 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,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 * * Redistribution and use in source and binary forms, with or without @@ -44,13 +47,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> @@ -58,6 +59,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. */ @@ -79,10 +87,6 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 -#include <unistd.h> -#endif - #ifdef __ECOS #include <cyg/jimtcl/jim.h> #else @@ -4687,7 +4691,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; @@ -4697,13 +4701,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); |