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]
Other format: [Raw text]

Re: random_sample: where did it go?


Igor Markov writes:
>  Another one: power()
> Ok, I can guess, it's in <ext/numeric>  :)
> but this makes things harder to figure out
> and also requires lots of #if(GCC_VERSION)

> Is there some way to avoid obfuscating source code
> with detailed gcc version checks?

You can use autoconf to search for the symbols, rather than checking for gcc
versions directly, if you're using autoconf 2.5x.  (Autoconf's checking for
type definitions in 2.1x is poor enough that you want to use the later
version.)

Checking for template types is somewhat tricky, because the comma in the
type name interferes with the syntax of m4, so you have to over-quote.  (I
think this is an autoconf bug, which I've reported.)  I've attached a
configure.ac file which works for me for detecting libstdc++'s hash_map
template class; tested with gcc 2.95.2, 3.0.2, and 3.1.

Attachment: configure.ac
Description: Text document

-- 
Jonathan Lennox
lennox@cs.columbia.edu

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