Ticket #9479: 40-libmythtv-bswap.diff

File 40-libmythtv-bswap.diff, 572 bytes (added by Lawrence Rust <lvr@…>, 9 years ago)
  • new file mythtv/libs/libmythtv/bswap.h

    diff --git a/mythtv/libs/libmythtv/bswap.h b/mythtv/libs/libmythtv/bswap.h
    new file mode 100644
    index 0000000..1fbb132
    - +  
     1#ifndef MYTHTV_BSWAP_H
     2#define MYTHTV_BSWAP_H
     3
     4#include <stdint.h> /* uint32_t */
     5#include <byteswap.h> /* bswap_16|32|64 */
     6
     7static __inline__ double bswap_dbl(double x)
     8{
     9    union {
     10        uint32_t l[2];
     11        double   d;
     12    } w, r;
     13    w.d = x;
     14    r.l[0] = bswap_32(w.l[1]);
     15    r.l[1] = bswap_32(w.l[0]);
     16    return r.d;
     17}
     18
     19#endif /* ndef MYTHTV_BSWAP_H */
     20