S_ISDIR/REG macros instead of S_IFDIR/REG flags

For less posixy places...