Ticket #314: rtems-rc-20021118-1.diff

File rtems-rc-20021118-1.diff, 1.2 KB (added by Ralf Corsepius, on Dec 3, 2006 at 1:31:12 PM)

rtems-rc-20021118-1.diff

  • cpukit/libcsupport/include/rtems/libio.h

    RCS file: /usr1/CVS/rtems/cpukit/libcsupport/include/rtems/libio.h,v
    retrieving revision 1.39
    diff -u -r1.39 libio.h
     
    2424#include <sys/stat.h>
    2525#include <sys/ioctl.h>
    2626
     27#include <limits.h>
     28
     29#ifndef CHAR_BIT
     30#define CHAR_BIT 8
     31#endif
     32
    2733/*
    2834 *  Define data types which must be constructed using forward references.
    2935 */
     
    456462 */
    457463
    458464#define rtems_filesystem_make_dev_t( _major, _minor ) \
    459   ((((dev_t)(_major)) << 32) | (dev_t)(_minor))
     465  ((((dev_t)(_major)) << ((sizeof(dev_t)/2) * CHAR_BIT)) | (dev_t)(_minor))
    460466
    461467#define rtems_filesystem_dev_major_t( _dev ) \
    462   (rtems_device_major_number) ((_dev) >> 32)
     468  (rtems_device_major_number) ((_dev) >> ((sizeof(dev_t)/2) * CHAR_BIT))
    463469
    464470#define rtems_filesystem_dev_minor_t( _dev ) \
    465   (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF)
     471  (rtems_device_minor_number) ((_dev) & ((dev_t) -1))
    466472
    467473#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
    468474  do { \