Re: glib.h: defining functions in header file
- From: Matthew Ahrens <mahrens cs brown edu>
- To: gtk-devel-list redhat com
- Subject: Re: glib.h: defining functions in header file
- Date: Tue, 29 Jun 1999 20:40:42 -0400 (EDT)
On Tue, 29 Jun 1999, Scott Michel wrote:
> Arguably, including glib.h and glibconfig.h without expecting to
> link glib is a bad programming practice, since they make internal
> calls to glib anyway. :-)
Which is exactly what I am complaining about. I suggest that header files
should not make calls to functions; they should declare functions and
preprocessor macros. Perhaps I am mistaken, but I believe that declaring a
function or pre-processor macro is not considered "calling" a function.
Of course, I agree with what I believe to be the spirit of your remark:
including a header file for a library that you are not linking with is
pretty sketchy.
I guess the situation that would be ideal for my case would be to have the
macros (basically everything covered under "GLib Fundamentals" in the
reference manual) defined in a separate header file. So projects which
just wanted to use glib's portability and convenience macros could include
only this header file.
--matt
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]