1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Moved the IExec initialization in "simple_sprintf.c".

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14954 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-05-18 07:22:52 +00:00
parent d4aa0b04af
commit f6d20fee01
3 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.7 2005-05-17 19:15:32 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.8 2005-05-18 07:22:51 obarthel Exp $
#
# :ts=8
#
@ -21,20 +21,20 @@ WARNINGS = \
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
INCLUDE = -I../library/include -I$(V)/include
INCLUDE = -I$(V)/include -I../library/include
LIB = -L../library/lib
#OPTIONS = -DNDEBUG -fno-builtin -DNO_INLINE_STDARG -DIEEE_FLOATING_POINT_SUPPORT
#OPTIONS = -D__MEM_DEBUG -fno-builtin
#OPTIONS = -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG -fno-builtin
OPTIMIZE = -O
OPTIONS = -DDEBUG -DNO_INLINE_STDARG -fno-builtin
#OPTIMIZE = -O
#OPTIMIZE = -O2 -fomit-frame-pointer
#DEBUG = -g2
DEBUG = -ggdb
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(CODE_TYPE) $(INCLUDE) $(LIB)
##############################################################################
LIBS = -lm -lc
LIBS = -lm -lc -ldebug -lgcc
##############################################################################
@ -99,4 +99,4 @@ fstat_stdout_test : fstat_stdout_test.o
simple_sprintf : simple_sprintf.o
@echo "Linking $@"
$(CC) -nostdlib $(CFLAGS) -o $@ simple_sprintf.o -lc -Wl,--cref,-M,-Map=$@.map
$(CC) -nostdlib $(CFLAGS) -o $@ simple_sprintf.o -lc -lgcc -Wl,--cref,-M,-Map=$@.map

View File

@ -1,5 +1,5 @@
/*
* $Id: simple_sprintf.c,v 1.1 2005-05-17 19:15:32 obarthel Exp $
* $Id: simple_sprintf.c,v 1.2 2005-05-18 07:22:52 obarthel Exp $
*
* :ts=4
*/
@ -54,14 +54,18 @@ _start(void)
SysBase = *(struct Library **)4;
#if defined(__amigaos4__)
{
IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface;
}
#endif /* __amigaos4__ */
DOSBase = OpenLibrary("dos.library",37);
if(DOSBase == NULL)
goto out;
#if defined(__amigaos4__)
{
IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface;
IDOS = (struct DOSIFace *)GetInterface(DOSBase, "main", 1, 0);
if(IDOS == NULL)
goto out;
@ -70,7 +74,7 @@ _start(void)
sprintf(string,"a %s c\n","b");
Write(Output(),string,strlen(string));
Write(Output(),string,(LONG)strlen(string));
out:

View File

@ -1,11 +1,14 @@
/*
* $Id: test.c,v 1.4 2005-01-30 10:23:26 obarthel Exp $
* $Id: test.c,v 1.5 2005-05-18 07:22:52 obarthel Exp $
*
* :ts=4
*/
/****************************************************************************/
#define __USE_INLINE__
#include <proto/exec.h>
#include <time.h>
#include <stdio.h>
#include <unistd.h>
@ -49,6 +52,8 @@ destructor_test2(void)
void __attribute__ ((destructor))
destructor_test3(void)
{
DebugPrintF("__iob = 0x%08lx\n",__iob);
fprintf(stderr,"destructor #3 called\n");
}