This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

major & minor macros?!?!?


I'm writing a C++ Version class that defines methods named major() and
minor() which return integer values of this Version's data. I'm not
quite sure but sometimes it works and sometimes it doesn't (especially
when I'm under a namespace) and complains that I'm using the macros
major and minor without any arguments. I can get rid of these errors
by using the following:

#ifdef major
	#undef major
#endif
#ifdef minor
	#undef minor
#endif

	before the method declarations. First off, what are these macros for
(and where are they defined) and why do method calls resolve to these
macros instead of their proper C++ class methods? If this turns out to
be a bug (and not just my stupidity), is using the above #undef's a
safe workaround for this issue?

	thanx & later,

		Ben Scherrey

PS: I'm using gcc-2.95.2 on a linux/Intel box running RedHat 6.x.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]