On Thu, 27 Jan 2005 10:21:59 +1100
Nick Piggin <[EMAIL PROTECTED]> wrote:
> It looks like the following condition may do the trick, do you think?
> Seems to do the right thing in a simple test file, anyway.
>
> #if !defined(PTRS_PER_XXX) || (PTRS_PER_XXX != 1)
It doesn't work, try the following which matches quite
precisely the sparc64 case.
extern int __get_ptrs_per_pmd(void);
#define PTRS_PER_PMD __get_ptrs_per_pmd()
int main(void)
{
#if !defined(PTRS_PER_PMD) || (PTRS_PER_PMD != 1)
return 1;
#endif
return 0;
}
It will warn like this:
foo.c:7:6: missing binary operator before token "("
foo.c:10:32: missing binary operator before token "("
Which looks exactly like the kind of warnings mm/memory.c was
producing for me on sparc64.
Let's just face it that this is not a compile time test in
any way. We could make it so by creating some kind of
PTRS_PER_PMD_MIGHT_BE_GREATER_THAN_ONE macro platforms can
define but this is getting really rediculious :-)