/*
	File:		ODSWAPW.h

	Contains:	Platform-specific swap routines

	Written by:	David Fox.

	Copyright:	c 1995 by Novell, Inc., all rights reserved.

	Change History (most recent first):

	To Do: eventually, Apple will deal with endianess on their platform and this file will
			need to be altered.
*/

#ifndef _ODSWAPW_
#define _ODSWAPW_

// todo: eventually this file should include cmapienv.h

#ifndef _ODTYPES_
#include "odtypes.h"
#endif

inline ODULong ODMoveFileLong(ODULong ul)
{
//todo: eventually uncomment #if (kCMDefaultEndian == 0)
//todo: eventually uncomment 	/* big endian machine */
#if 1		// todo: eventually remove this line 
	ODULong ret;
	char *src;
	char *dst;
	dst = (char *) &ret;
	src = ((char *) &ul) + 3;
	*dst++ = *src--;
	*dst++ = *src--;
	*dst++ = *src--;
	*dst = *src;
	return ret;
#else
	return ul;
#endif
}


inline ODUShort ODMoveFileShort(ODUShort us)
{
//todo: eventually uncomment #if (kCMDefaultEndian == 0)
//todo: eventually uncomment 	/* big endian machine */
#if 1		// todo: eventually remove this line 
	ODUShort ret;
	char *src;
	char *dst;
	dst = (char *) &ret;
	src = ((char *) &us) + 1;
	*dst++ = *src--;
	*dst = *src;
	return ret;
#else
	return us;
#endif
}

#endif
