Bug 8882

Summary: Mac OS X has no byteswap.h C header file
Product: xorg Reporter: Peter Dyballa <Peter_Dyballa>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high    
Version: 7.1 (2006.05)   
Hardware: PowerPC   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Proposed patch to make these xserver/GLX/gl files compile under Mac OS X 10.4.8 none

Description Peter Dyballa 2006-11-04 03:56:26 UTC
The files swap_interval.c, indirect_util.c, indirect_texture_compression.c, indirect_program.c, 
indirect_dispatch_swap.c xserver/GL/glx make use of a Linux C header file, byteswap.h, to swap bytes in 
integers. In Mac OS X, version 10.4 at least, this functionality is put into libkern/OSByteOrder.h. So these 
files might need a block like:

	#elif defined(__APPLE__)
	#include <libkern/OSByteOrder.h>
	#define bswap_16 OSSwapInt16
	#define bswap_32 OSSwapInt32
	#define bswap_64 OSSwapInt64

after

	#ifdef __linux__
	#include <byteswap.h>
	#elif defined(__OpenBSD__)
	#include <sys/endian.h>
	#define bswap_16 __swap16
	#define bswap_32 __swap32
	#define bswap_64 __swap64

and before

	#else
	#include <sys/endian.h>
	#define bswap_16 bswap16
	#define bswap_32 bswap32
	#define bswap_64 bswap64
	#endif
Comment 1 Peter Dyballa 2006-11-08 13:42:15 UTC
Created attachment 7706 [details] [review]
Proposed patch to make these xserver/GLX/gl files compile under Mac OS X 10.4.8

Part of this patch was originally written by Peter O'Gorman.
Comment 2 Daniel Stone 2007-02-27 01:34:20 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 Peter Dyballa 2007-03-11 13:29:26 UTC
This is GLX related, too, which is not supported for XDarwin, so it's a faulty bug report.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.