X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsame-inode.h;h=3843b0707858bc23af608b7563dd0869ae2831bc;hb=03e96cc338b5237e15fce73e9423526969ee768a;hp=4b89dd1a61a8d655e988588d26645e80bde1fe7c;hpb=b5eb8386645bf1bcfafa63c729ff9a86454def87;p=gnulib.git diff --git a/lib/same-inode.h b/lib/same-inode.h index 4b89dd1a6..3843b0707 100644 --- a/lib/same-inode.h +++ b/lib/same-inode.h @@ -1,6 +1,6 @@ /* Determine whether two stat buffers refer to the same file. - Copyright (C) 2006, 2009 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,18 +18,16 @@ #ifndef SAME_INODE_H # define SAME_INODE_H 1 -/* Perform a tri-state query on whether STAT_BUF_1 and STAT_BUF_2 - represent the same file. Return 1 for equal, 0 for distinct, and - -1 for indeterminate (the latter is generally possible only on - mingw). Algorithms that use this macro must be prepared to handle - the indeterminate case without wrong results. For example, if an - optimization is possible if two files are the same but unsafe if - distinct, use SAME_INODE()==1; whereas for an optimization that is - possible only for distinct files, use !SAME_INODE(). */ - -# define SAME_INODE(Stat_buf_1, Stat_buf_2) \ - (((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \ - && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev) \ - ? 1 - 2 * !(Stat_buf_1).st_ino : 0) +# ifdef __VMS +# define SAME_INODE(a, b) \ + ((a).st_ino[0] == (b).st_ino[0] \ + && (a).st_ino[1] == (b).st_ino[1] \ + && (a).st_ino[2] == (b).st_ino[2] \ + && (a).st_dev == (b).st_dev) +# else +# define SAME_INODE(a, b) \ + ((a).st_ino == (b).st_ino \ + && (a).st_dev == (b).st_dev) +# endif #endif