Re: why #if defined(__cplusplus)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

John Que wrote:
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
__cplusplus is used by the c++ compiler.

I wonder:
Why is this #ifdef exist at all if we know for sure that you can't compile the kernel as a C++ source code?
Because sometimes we want to use the c++ compiler to compile some other source code. When we compile the kernel we use the c compiler.

--
William J Beksi                          <wjbeksi@xxxxxxxxxxxxxxxxxxxxx>
GPG Key Fingerprint = ED4B 32C3 69E6 C2B7 705C  263F CB2F 3253 E7E1 DB3B

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux