Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>cdecl external name modifier</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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);
           }

See Also: Pascal

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson