Bug 8882 - Mac OS X has no byteswap.h C header file
Summary: Mac OS X has no byteswap.h C header file
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.1 (2006.05)
Hardware: PowerPC Mac OS X (All)
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-04 03:56 UTC by Peter Dyballa
Modified: 2007-03-11 13:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch to make these xserver/GLX/gl files compile under Mac OS X 10.4.8 (2.27 KB, patch)
2006-11-08 13:42 UTC, Peter Dyballa
no flags Details | Splinter Review

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.