On Friday, July 5, 2019 at 7:23:03 PM UTC-4, G G wrote:
> On Friday, July 5, 2019 at 7:20:02 PM UTC-4, G G wrote:
> > On Friday, July 5, 2019 at 7:10:24 PM UTC-4, Öö Tiib wrote:
...
> > > >
http://www.minix3.org/documentation/AppendixB.pdf
> > > >
> > > > line 00034
> > >
> > > Can you notice that it is Minix 3 implemented in C programming
> > > language.
> >
> > yes
>
> i stop at line 34. preprocessor macros
>
> are you say those preprocessor statement would not work in C++?
The #define itself works the same way in both languages. However, which
definition is given to that macro depends upon whether __STDC__ is
#defined, and also upon how it is defined. The double underscores at
the beginning mean that__STDC__ is a reserved identifier for C++, but
the C++ standard specifies nothing about what value it has. So yes, the
wrong definition for that prototype might be chosen.
More directly to the point, those preprocessor directives (the two
#defines for PROTOTYPE, as well at the #if, #else, and #endif that
determine which #define to execute), solve a problem that has never
existed in C++: backwards compatibility with pre-standard C compilers.
If you're making any significant use of any feature that is specific to
C++, compatibility with pre-standard C compilers is simply an
impossibility. Even in C code, the ability to compile with pre-standard
compilers ceased being a significant issue for most developers a long
time ago - the first C standard is 30 years old - older than many
(most?) of the people writing C code.