Ticket #21912: byteswap-osx.patch
File byteswap-osx.patch, 2.5 KB (added by jeremy.laine@…, 15 years ago) |
---|
-
kstars/kstars/binfilehelper.cpp
old new 38 38 #define bswap_16(x) bswap16(x) 39 39 #define bswap_32(x) bswap32(x) 40 40 #else 41 #if defined(Q_OS_MAC) 42 #include <libkern/OSByteOrder.h> 43 #define bswap_16(x) OSSwapInt16(x) 44 #define bswap_32(x) OSSwapInt32(x) 45 #else 41 46 #include <byteswap.h> 42 47 #endif 43 48 #endif 49 #endif 44 50 45 51 class BinFileHelper; 46 52 -
kstars/kstars/skycomponents/starcomponent.cpp
old new 38 38 #include "binfilehelper.h" 39 39 #include "starblockfactory.h" 40 40 41 // Byte-swapping support. 42 // 43 // bswap_16 is a linuxism, use BSWAP_16 define on Solaris, 44 // probably need to usw BSD's swap16() on FreeBSD. This could 45 // use some cmake checks to actually check for the supported 46 // include files and which form of byte swapping to use. 47 // 48 #ifdef Q_OS_SOLARIS 49 #include <sys/byteorder.h> 50 #define bswap_16(x) BSWAP_16(x) 51 #define bswap_32(x) BSWAP_32(x) 52 #else 41 53 #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) 42 54 #include <sys/endian.h> 43 55 #define bswap_16(x) bswap16(x) 44 56 #define bswap_32(x) bswap32(x) 45 57 #else 58 #if defined(Q_OS_MAC) 59 #include <libkern/OSByteOrder.h> 60 #define bswap_16(x) OSSwapInt16(x) 61 #define bswap_32(x) OSSwapInt32(x) 62 #else 46 63 #include <byteswap.h> 47 64 #endif 65 #endif 66 #endif 48 67 49 68 #include <kde_file.h> 50 69 -
kstars/kstars/skycomponents/deepstarcomponent.cpp
old new 53 53 #define bswap_16(x) bswap16(x) 54 54 #define bswap_32(x) bswap32(x) 55 55 #else 56 #if defined(Q_OS_MAC) 57 #include <libkern/OSByteOrder.h> 58 #define bswap_16(x) OSSwapInt16(x) 59 #define bswap_32(x) OSSwapInt32(x) 60 #else 56 61 #include <byteswap.h> 57 62 #endif 58 63 #endif 64 #endif 59 65 60 66 DeepStarComponent::DeepStarComponent( SkyComponent *parent, QString fileName, float trigMag, bool staticstars ) 61 67 : ListComponent(parent), m_reindexNum( J2000 ), triggerMag( trigMag ), m_FaintMagnitude(-5.0),