Menu

What is CRTIMP and cdecl?

bettger
2005-08-07
2012-09-26
  • bettger

    bettger - 2005-08-07

    I'm a newbie. Looking at "hello world" program,the first line was:
    #include <stdio.h>

    I opened stdio.h to see wat's iside and found a lot of lines that look like:

    _CRTIMP FILE __cdecl fopen (const char, const char*);

    Now I understand the prototype
    FILE fopen (const char, const char*);
    but I don't understand
    _CRTIMP and __cdecl

    Can anybody explain what that is?

    Thanks Frank B

     
    • Nobody/Anonymous

      need to know basis :p

      i've looked in the files below stdio.h and in the file _mingw.h

      _CRTIMP and __cdecl are declared
      there is this in a (longer) comment
      ".._CRTIMP As above. For MS compatibility. ..."

      dont know exactly how it can be for MS compatibility. dont think you should try to make use of the internals of stdio.h (as it says in the file) but maybe it gives some insight

       
    • Nobody/Anonymous

      cdecl refers to a 'calling convention' and is the standard for C / C++ programs. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_core___cdecl.asp I'm thinking that CRTIMP is part of the return typing, probably something like C RunTime IMPort though I'd didn't find a helpful link to support that. It looks that it's usually defined as:

      define _CRTIMP __declspec(dllimport)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.