Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <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
    this 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 Switches

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