[net.lang.c++] C++'s stdio.h

little@sdcsvax.UUCP (Glenn Little) (05/20/86)

   Hi.  We are having a problem with C++ on a machine running BSD 4.3
   Unix.  We are using version 1.0 of C++.  This problem happens when we
   try to #include <curses.h> in a program.  Curses.h turns around and
   tries to include <unctrl.h> and <termio.h>, neither of which we have.

   There is a mechanism in curses.h that is supposed to include 
   <termio.h> only if USG is set.  I believe that the #include <unctrl.h>
   belongs inside the "#ifdef USG" as well.  Has anyone else seen this
   problem, and if so does this sound like a reasonable solution?

   The above still won't work in our case, because USG always gets set 
   by an earlier statement in <curses.h>:

	ifdef L_ctermid
	define USG
	endif
   
   I think the problem is that our C++ stdio.h, which is included by curses.h, 
   unconditionally defines L_ctermid to be "9".  Looking into this, we noticed
   that our C++ stdio.h is substantially different from the 4.3
   stdio.h in several ways, the definitions of getc and putc being two
   examples.  At this point we see two choices... we can ignore the above
   differences and just get rid of the "#define L_ctermid", or we can
   adapt the 4.3 stdio.h to be acceptable to c++ (i.e. add to the 4.3
   stdio.h those functions that return ints, fill in argument declarations...)
   Since I don't know the underlying mechanisms of C++ too well, it's 
   hard for me to tell whether the latter solution will help, or just 
   make things worse.  Has anyone dealt with this one?  Any opinions,
   ideas, or comments?

   Thanks a lot for any help you can offer.

				Glenn Little
				UCSD EECS department
				(619) 452-4595