mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added local inline function definitions for the two rexxsyslib.library V45
API functions, rather than omitting support for them in the 68k build. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15182 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: amiga_rexxvars.c,v 1.11 2008-03-11 07:37:31 damato Exp $
|
* $Id: amiga_rexxvars.c,v 1.12 2008-03-11 13:26:18 obarthel Exp $
|
||||||
*
|
*
|
||||||
* :ts=4
|
* :ts=4
|
||||||
*
|
*
|
||||||
@ -58,6 +58,60 @@
|
|||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
/* This side-steps issues with very old inline header files, predating the
|
||||||
|
OS 3.5 SDK, when the library is built for the 68k platform. */
|
||||||
|
#if defined(__GNUC__) && !defined(__amigaos4__)
|
||||||
|
|
||||||
|
#define __GetRexxVarFromMsg(name, buffer, message) ({ \
|
||||||
|
STRPTR _GetRexxVarFromMsg_name = (name); \
|
||||||
|
STRPTR _GetRexxVarFromMsg_buffer = (buffer); \
|
||||||
|
struct RexxMsg * _GetRexxVarFromMsg_message = (message); \
|
||||||
|
LONG _GetRexxVarFromMsg__re = \
|
||||||
|
({ \
|
||||||
|
register struct RxsLib * const __GetRexxVarFromMsg__bn __asm("a6") = (struct RxsLib *) (RexxSysBase);\
|
||||||
|
register LONG __GetRexxVarFromMsg__re __asm("d0"); \
|
||||||
|
register STRPTR __GetRexxVarFromMsg_name __asm("a0") = (_GetRexxVarFromMsg_name); \
|
||||||
|
register STRPTR __GetRexxVarFromMsg_buffer __asm("a1") = (_GetRexxVarFromMsg_buffer); \
|
||||||
|
register struct RexxMsg * __GetRexxVarFromMsg_message __asm("a2") = (_GetRexxVarFromMsg_message); \
|
||||||
|
__asm volatile ("jsr a6@(-492:W)" \
|
||||||
|
: "=r"(__GetRexxVarFromMsg__re) \
|
||||||
|
: "r"(__GetRexxVarFromMsg__bn), "r"(__GetRexxVarFromMsg_name), "r"(__GetRexxVarFromMsg_buffer), "r"(__GetRexxVarFromMsg_message) \
|
||||||
|
: "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
|
||||||
|
__GetRexxVarFromMsg__re; \
|
||||||
|
}); \
|
||||||
|
_GetRexxVarFromMsg__re; \
|
||||||
|
})
|
||||||
|
|
||||||
|
#undef GetRexxVarFromMsg
|
||||||
|
#define GetRexxVarFromMsg(name, buffer, message) __GetRexxVarFromMsg(name, buffer, message)
|
||||||
|
|
||||||
|
#define __SetRexxVarFromMsg(name, value, message) ({ \
|
||||||
|
STRPTR _SetRexxVarFromMsg_name = (name); \
|
||||||
|
STRPTR _SetRexxVarFromMsg_value = (value); \
|
||||||
|
struct RexxMsg * _SetRexxVarFromMsg_message = (message); \
|
||||||
|
LONG _SetRexxVarFromMsg__re = \
|
||||||
|
({ \
|
||||||
|
register struct RxsLib * const __SetRexxVarFromMsg__bn __asm("a6") = (struct RxsLib *) (RexxSysBase);\
|
||||||
|
register LONG __SetRexxVarFromMsg__re __asm("d0"); \
|
||||||
|
register STRPTR __SetRexxVarFromMsg_name __asm("a0") = (_SetRexxVarFromMsg_name); \
|
||||||
|
register STRPTR __SetRexxVarFromMsg_value __asm("a1") = (_SetRexxVarFromMsg_value); \
|
||||||
|
register struct RexxMsg * __SetRexxVarFromMsg_message __asm("a2") = (_SetRexxVarFromMsg_message); \
|
||||||
|
__asm volatile ("jsr a6@(-498:W)" \
|
||||||
|
: "=r"(__SetRexxVarFromMsg__re) \
|
||||||
|
: "r"(__SetRexxVarFromMsg__bn), "r"(__SetRexxVarFromMsg_name), "r"(__SetRexxVarFromMsg_value), "r"(__SetRexxVarFromMsg_message) \
|
||||||
|
: "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
|
||||||
|
__SetRexxVarFromMsg__re; \
|
||||||
|
}); \
|
||||||
|
_SetRexxVarFromMsg__re; \
|
||||||
|
})
|
||||||
|
|
||||||
|
#undef SetRexxVarFromMsg
|
||||||
|
#define SetRexxVarFromMsg(name, value, message) __SetRexxVarFromMsg(name, value, message)
|
||||||
|
|
||||||
|
#endif /* __GNUC__ && !__amigaos4__ */
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
static struct Library * RexxSysBase;
|
static struct Library * RexxSysBase;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
@ -163,7 +217,6 @@ GetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR *buffer_pointer)
|
|||||||
static TEXT buffer[256];
|
static TEXT buffer[256];
|
||||||
LONG result;
|
LONG result;
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
/* The following uses a function which was added to rexxsyslib.library V45.
|
/* The following uses a function which was added to rexxsyslib.library V45.
|
||||||
We therefore have a minimum library version requirement. */
|
We therefore have a minimum library version requirement. */
|
||||||
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
|
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
|
||||||
@ -174,9 +227,6 @@ GetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR *buffer_pointer)
|
|||||||
|
|
||||||
/* The 256 character limit isn't good. This should be done differently. */
|
/* The 256 character limit isn't good. This should be done differently. */
|
||||||
result = GetRexxVarFromMsg(variable_name,buffer,message);
|
result = GetRexxVarFromMsg(variable_name,buffer,message);
|
||||||
#else
|
|
||||||
result = ERR10_015; /* function not found */
|
|
||||||
#endif
|
|
||||||
if(result != 0)
|
if(result != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -197,7 +247,6 @@ SetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR value,ULONG lengt
|
|||||||
{
|
{
|
||||||
LONG result;
|
LONG result;
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
/* The following uses a function which was added to rexxsyslib.library V45.
|
/* The following uses a function which was added to rexxsyslib.library V45.
|
||||||
We therefore have a minimum library version requirement. */
|
We therefore have a minimum library version requirement. */
|
||||||
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
|
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
|
||||||
@ -207,9 +256,6 @@ SetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR value,ULONG lengt
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = SetRexxVarFromMsg(variable_name,value,message);
|
result = SetRexxVarFromMsg(variable_name,value,message);
|
||||||
#else
|
|
||||||
result = ERR10_015; /* function not found */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
|
|||||||
@ -4,14 +4,15 @@
|
|||||||
trouble while performing the conversion.
|
trouble while performing the conversion.
|
||||||
|
|
||||||
- [tboeckel]: when compiling amiga_rexxvars.c for m68k/OS3 the GetRexxVarFromMsg()
|
- [tboeckel]: when compiling amiga_rexxvars.c for m68k/OS3 the GetRexxVarFromMsg()
|
||||||
and SetRexxVarFromMsg() will not be used and therefore not cause linkage errors
|
and SetRexxVarFromMsg() can no longer cause linkage errors if the header files
|
||||||
with our libamiga.a stubs anymore.
|
predate the SDK for OS 3.5.
|
||||||
|
|
||||||
- [jlangner]: the log() and log10() functions always returned -inf() even if the
|
- [jlangner]: the log() and log10() functions always returned -inf() even if the
|
||||||
arguments was within the valid range for a log() function. Using DBL_EPSILON as
|
arguments was within the valid range for a log() function. Using DBL_EPSILON as
|
||||||
the threshold was not correct as EPSILON is 2.2204460492503131E-16 whereas
|
the threshold was not correct as EPSILON is 2.2204460492503131E-16 whereas
|
||||||
values like 1E-200 are still valid double values for a log().
|
values like 1E-200 are still valid double values for a log().
|
||||||
|
|
||||||
|
|
||||||
c.lib 1.202 (16.1.2007)
|
c.lib 1.202 (16.1.2007)
|
||||||
|
|
||||||
- Added llrint() function contributed by Henning Nielsen Lund. Thank you
|
- Added llrint() function contributed by Henning Nielsen Lund. Thank you
|
||||||
|
|||||||
Reference in New Issue
Block a user