book-exploring-async-basics
book-exploring-async-basics copied to clipboard
[Translation] 3_1_communicating_with_the_os.md
Hi, I have a question about this chapter.
Is The character 'c' further down case sensitive? I mean is there any difference with 'c' between 'C'?
extern "C" or only extern (C is assumed if nothing is specified) means we're linking to specific functions in the "c" library using the "C" calling convention. As you'll see on Windows we'll need to change this since it uses a different calling convention than the UNIX family.
and Does it mean C language?
I mean is there any difference with 'c' between 'C'?
Well, yes there is a difference. The #[link(name = "c")] directive (in lowercase) means that we link to the C library on that platform. Honestly, I haven't tried it with an uppercase C so I'm not 100 % sure that will work.
The extern "C" uppercase C refers to the C language, or more specifically that we want to use the C Application Binary Interface (ABI). So both refer to the C language but the lowercase "c" refers to the c-library on the linux platform, and the uppercase "C" refers to the C ABI.