Guardian Application Conversion Guide
Recompiling Your C Program
Converting C Applications
5–4 096047 Tandem Computers Incorporated
Changing Memory-Model
File References
If your program uses a SEARCH compiler pragma to specify a memory-model file (to
search when resolving external references), you must change the name of the
memory-model file as follows:
C-Series pragma Format (Superseded) D-Series pragma Format
#pragma SEARCH smallc #pragma SEARCH csmall
#pragma SEARCH largec #pragma SEARCH clarge
#pragma SEARCH widec #pragma SEARCH cwide
Opening Temporary Files Temporary files must be opened with either the ANSI tempfile function or the
Guardian FILE_CREATE_ procedure.
C-Series open Supplementary Function (Superseded)
char temp_file[26] = "$spool ";
int status;
status = open (temp_file, O_CREATE | O_BINARY);
D-Series FILE_CREATE_ Procedure
char temp_file[26] = "$spool";
short error;
short volume_length = 6;
error = FILE_CREATE_ (temp_file, volume_length,
filename_length);
Replacing min and max
Macros
You must change the following macros in your program:
C-Series Macro (Superseded) D-Series Macro
min _min
max _max
Including the Macro NULL
Definition
The definition of the object-like macro NULL was removed from the C header files
ASSERTH, CTYPEH, ERRNOH, FLOATH, LIMITSH, MATHH, and SETJMPH to
make these header files conform to the ANSI standard.
If your program uses the macro NULL, you must include a standard library header file
which declares the macro, such as STDIOH.
Changing Macro
Definitions
The D-series compiler macro processing has been changed to conform to the ANSI
standard. You must change your macros to use a # directive to replace parameters
inside a literal string.
The following macro is valid for C-series compilers:
#define pr(x, format) printf("The x = %format\n", (x))
You must change this macro for D-series compilers as follows:
#define pr(x, format) printf("The " #x " = %% " #format \
"\n", (x))