_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

myendian.h File Reference
#include "SDL_byteorder.h"
#include "SDL_endian.h"

Go to the source code of this file.

Macros

myendian.h - The endian-specific headerfile.
#define ConvertLE16(v)   SDL_SwapLE16((v))
 
#define ConvertLE32(v)   SDL_SwapLE32((v))
 
#define AccessLE16(p)   SDL_SwapLE16(*((unsigned short *)(p)))
 
#define AccessLE32(p)   SDL_SwapLE32(*((unsigned int *)(p)))
 
#define FetchLE16(p)   SDL_SwapLE16(*((unsigned short *)(p))); p += 2
 
#define FetchLE32(p)   SDL_SwapLE32(*((unsigned int *)(p))); p += 4
 
#define STRATAGUS_LITTLE_ENDIAN
 

Macro Definition Documentation

◆ AccessLE16

#define AccessLE16 (   p)    SDL_SwapLE16(*((unsigned short *)(p)))

Access a 16 bit value in little endian and return it in native format.

◆ AccessLE32

#define AccessLE32 (   p)    SDL_SwapLE32(*((unsigned int *)(p)))

Access a 32 bit value in little endian and return it in native format.

◆ ConvertLE16

#define ConvertLE16 (   v)    SDL_SwapLE16((v))

Convert a 16 bit value in little endian and return it in native format.

◆ ConvertLE32

#define ConvertLE32 (   v)    SDL_SwapLE32((v))

Convert a 32 bit value in little endian and return it in native format.

◆ FetchLE16

#define FetchLE16 (   p)    SDL_SwapLE16(*((unsigned short *)(p))); p += 2

Fetch a 16 bit value in little endian with incrementing pointer and return it in native format.

◆ FetchLE32

#define FetchLE32 (   p)    SDL_SwapLE32(*((unsigned int *)(p))); p += 4

Fetch a 32 bit value in little endian with incrementing pointer and return it in native format.

◆ STRATAGUS_LITTLE_ENDIAN

#define STRATAGUS_LITTLE_ENDIAN
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.