Actually, it does compile now that I look closer (I had a second problem
confusing me), but it does generate quite a few warnings like this:
pvfs2/include/pvfs2-sysint.h:44:5: warning: "INTPTR_MIN" is not defined
pvfs2/include/pvfs2-sysint.h:44:19: warning: "INT32_MIN" is not defined
Not sure what the ramifications are of the warning, though.
-Phil
Phil Carns wrote:
Is INTPTR_MIN defined in the kernel headers somewhere as well? I am
having a hard time compiling the kerne module at the moment because
/kernel/linux-2.6/pvfs2-utils.c ends up pulling in pvfs2-sysint.h. I am
using the 2.6.15.4 kernel.
-Phil
Sam Lang wrote:
This seems to work everywhere we tried, so I went ahead and committed
that change. Thanks Pete!
-sam
On Apr 4, 2006, at 12:15 PM, Pete Wyckoff wrote:
[EMAIL PROTECTED] wrote on Tue, 04 Apr 2006 11:32 -0500:
Hm...actually I didn't notice before but the use of __WORDSIZE or
BITS_PER_LONG will break on darwin (which doesn't define either).
Previously, I fixed this by defining SIZEOF_LONG_INT and
SIZEOF_VOID_P in pvfs2-config.h, but the PVFS_sys_attr_s struct now
includes padding and that struct is defined in pvfs2-sysint.h, which
is an external header.
Posix defines intptr_t as an int that can hold a pointer, hence you
can get your word size out of that. Then this should work and uses
only constants that POSIX requires in <stdint.h>:
#if INTPTR_MIN == INT32_MIN
32-bit
#else
not 32-bit
#endif
Appears visually to be okay on darwin, x86, and x86_64. But I've
never tried it in real life. Too bad there appears to be no direct
wordsize in posix anywhere.
Another approach would be with unions:
struct PVFS_sys_attr_s {
...
union {
char _s[8];
char *link_target;
};
...
}
But I haven't tried that either. On ancient gcc you need to give
the union a name then "#define link_target _u.link_target", e.g.
-- Pete
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers