[svn-r4232] Purpose:

Bug fix.
Description:
    On some systems (linux when not using gcc) 'dev_t' is not actually
    a scalar variable.  This causes the code which compares dev_t's in
    the file drivers to not compile.  Also the H5_inline flag was not being
    set correctly in the H5private.h file.
Solution:
    Set the H5_inline flag to '' (i.e. define it, but don't assign it a value)
    if it is not currently defined.

    Use DEV_T_IS_SCALAR flag from configure to correctly compare dev_t's using
    memcmp instead of a scalar flag.
Platforms tested:
    FreeBSD 4.3 (hawkwind), Linux 2.4.2 (chiba city cluster at Argonne)
This commit is contained in:
Quincey Koziol
2001-07-17 16:27:06 -05:00
parent 857e0e6e57
commit 5c8bcc1917
5 changed files with 36 additions and 9 deletions

View File

@@ -390,8 +390,17 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if (f1->fileindexlo > f2->fileindexlo) ret_value= 1;
#else
#ifdef H5_DEV_T_IS_SCALAR
if (f1->device < f2->device) ret_value= -1;
if (f1->device > f2->device) ret_value= 1;
#else /* H5_DEV_T_IS_SCALAR */
/* If dev_t isn't a scalar value on this system, just use memcmp to
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))<0) ret_value= -1;
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) ret_value= 1;
#endif /* H5_DEV_T_IS_SCALAR */
if (f1->inode < f2->inode) ret_value= -1;
if (f1->inode > f2->inode) ret_value= 1;