From e370d3d50f3fa02dc9b3fe13a2456dcb232a99d6 Mon Sep 17 00:00:00 2001 From: oyvind Date: Mon, 19 Oct 2009 15:18:08 +0200 Subject: Fix eCos compatiblity problems with autotools. --- jim.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'jim.c') diff --git a/jim.c b/jim.c index 8d8a619..8319c25 100644 --- a/jim.c +++ b/jim.c @@ -2,13 +2,16 @@ * * Copyright 2005 Salvatore Sanfilippo * Copyright 2005 Clemens Hintze - * Copyright 2005 patthoyts - Pat Thoyts - * Copyright 2008 oharboe - �yvind Harboe - oyvind.harboe@zylin.com + * Copyright 2005 patthoyts - Pat Thoyts + * Copyright 2008,2009 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn * Copyright 2008 Duane Ellis * Copyright 2008 Uwe Klein * Copyright 2008 Steve Bennett - * + * Copyright 2009 Nico Coesel + * 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 -#endif -#ifndef JIM_ANSIC -#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ -#endif /* JIM_ANSIC */ - #include #include + +typedef CYG_ADDRWORD intptr_t; + #include #include #include @@ -58,6 +59,13 @@ #include #include #include +#endif +#ifndef JIM_ANSIC +#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ +#endif /* JIM_ANSIC */ + +#include +#include /* Include the platform dependent libraries for * dynamic loading of libraries. */ @@ -79,10 +87,6 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 -#include -#endif - #ifdef __ECOS #include #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); -- cgit v1.1