home *** CD-ROM | disk | FTP | other *** search
-
- The following are things to keep in mind when writing new code so that
- it compiles cleanly under registered DICE, unregistered DICE and SASC.
-
- 1) Make sure every function has an ANSI style declaration to prevent
- SASC warnings.
-
- 2) DICE and SASC sometimes disagree about which function arguments
- are declared const. For example:
-
- extern int stricmp(char *, char *); //SASC
- extern int stricmp(const char *, const char *); //DICE
-
- If you pass a const pointer to stricmp(), cast away the constness
- to suppress an SASC compiler warning.
-
- For example:
-
- const char *p = "abc";
- const char *q = "def";
-
- stricmp((char *)p, (char *)q);
-
- 3) The SASC compiler option ObjectName is used to specify where the
- resulting object code should be placed. The sc command has a bug which
- prevents ObjectName= from being used when compiling an assembly file.
- This required assembly files to be handled seperatly from c files in
- the lib dmakefile. Assembly objects are compiled into the current
- directory and then copied to their final destination.
-
- 4) The preprocessor symbol indicating that code is being compiled for
- an amiga differs between DICE and SASC.
-
- DICE uses AMIGA
- SASC uses _AMIGA
-
- If you have AMIGA dependant code, the following at the start of your
- c file will ensure it works under SASC too.
-
- #if defined (_AMIGA) && !defined (AMIGA)
- #define AMIGA
- #endif
-
- 5) The registered version of DICE provides the __autoinit and __autoexit
- features, but the unregistered version does not. These features are
- much like the _STI and _STD features of SASC. They are great for
- writing startup code that will automatically open a referenced
- library.
-
- 6) To convert a dmakefile which invokes DICE to a dmakefile which
- invokes SASC, or vica versa, you can use the adj utility. Adj
- will scan the file looking for compiler options and convert
- them. Adj also provides conditionals.
-
- Good luck, Chris Genly, 6/9/93
-