cdecl                    External Name Modifier
 
    When C generates a function call, by default it adds a leading
    underscore to the function name and declares it as an external.  C
    also preserves the casing of the name.  Since Pascal (and Fortran,
    for that matter) do not expect an underscore to be preprended and do
    expect the name to be in uppercase, you can instruct the compiler to
    omit the leading underscore and translate the name to all uppercase
    for all functions, by using the -p option.  If when using the -u
    option you find the need to ensure that certain identifiers remain C
    compatible (i.e., have their case preserved and have a leading
    underscore prepended), you can use the `cdecl' keyword.
 
      Notes:    All functions in the header files of Turbo C (for
                example, "stdio.h") are of type cdecl.  This ensures that
                you can link with the library routines, even when you're
                compiling using the -p option.
 
  -------------------------------- Example ---------------------------------
 
           /* this file is compiled with -p */
 
           int cdecl fp(a, b, c)
           int a;
           long b;
           double c;
           {
                ...
           }
 
           int cdecl table[100];
 
           main()
           {
                extern int cdecl fp();
                int i;
 
                i = fp(1, 2L, 1.2);
           }

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster