home *** CD-ROM | disk | FTP | other *** search
-
- FDTOPRAGMA / 3.0 INCLUDES GENERATED PRAGMAS
-
- If you compile under the -3.0 model using the 3.0 includes, generally
- something only feasible if you have a hard drive, you can use pragmas
- to access system libraries. You can use FDTOPRAGMA to create pragmas
- for third party libraries as described in the FDTOPRAGMA section below.
-
- In your C source you should use #include <proto/exec.h> instead of
- #include <clib/exec.h>. Then use the -mi option to DCC. Be sure
- your DCCOPTS are setup to use the 3.0 includes:
-
- /*
- * TEST.C
- */
-
- #include <proto/exec.h>
- #include <stdio.h>
-
- main(int ac, char **av)
- {
- printf("%08lx\n", FindTask(NULL));
- return(0);
- }
-
-
- Then, generate some assembly (just so you can see what it does):
-
- dcc test.c -o t:test.a -a -mi -mRR
-
- USING PRAGMAS TO ACCESS LOCAL LIBRARY BASES
-
- The library base specified in any given #pragma is always accessed from
- the current semantic context. That means you can override it:
-
- fubar()
- {
- long SysBase = ...
-
- FindTask(...); etc...
- }
-
- Many libraries require a library base to be openned for each task, so
- when you use CreateTask() or CreateNewProc() to create several
- instances sharing the same global data you may have to access certain
- libraries with a base variable openned for the particular task/process
- the call is made from. While DICE does not do this for you
- automatically, you can write code to do it and then access the special
- library base via a local context'd pragma base variable:
-
- Also note that you may have to use __geta4 for the start procedure for
- each new task to reload A4 with the appropriate shared data base. This
- precludes being able to compile something resident (-r doesn't work
- when you use __geta4).
-
- fubar()
- {
- long GlugBase = SpecificLibBaseForThisProcess;
-
- GlugLibraryCallUsingPragma() ...
- }
-
- NOTE!!!! The current registered release of DICE cannot deal with SAS/C
- pragmas. There are a couple of bugs, so you should only use files
- generated with FDTOPRAGMA with DICE.
-
-
- USING FDTOPRAGMA
-
-
- NOTE: you must be setup to compile using the 3.0 includes via DCCOPTS.
- Here are two ways of setting up DCCOPTS:
-
- set DCCOPTS "-// -3.0"
- setenv DCCOPTS "-// -3.0"
-
-
- EXAMPLE USAGE - generate a single pragma file:
-
- set DCCOPTS "-3.0 -//"
- cd dinclude:
- fdtopragma amiga30/fd/exec_lib.fd amiga30/clib/exec_protos.h -o t:x.h
-
- EXAMPLE USAGE - generate pragma files for all FD's in a directory
- (NOTE: hanging slashes (/) at end are REQUIRED)
-
- set DCCOPTS "-3.0 -//"
- cd dinclude:
- mkdir t:test
- fdtopragma amiga30/fd/ amiga30/clib/ -o t:test/
-
-
-