Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_cdecl external name modifier</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _cdecl                  External Name Modifier

    If the compile-time switch /Gc is used, the Fortran/Pascal calling
    sequence is used by default for all function declarations and
    definitions. In this case, to call a C function you must override the
    default by using the _cdecl keyword. The keyword may also be applied
    to external variables that are to be shared with another C function.

    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.  When the /Gc switch is used,
    the underscore is not added and the name is converted to all upper-
    case, so as to be compatible with the MS-Fortran and MS-Pascal
    compiler code generation.  The same occurs with external variables
    that do not have the _cdecl attribute.

   -------------------------------- Example ---------------------------------

           /* this file is compiled with /Gc */

           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 _fortran

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