X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Ffnetorderstream.h;h=f58550b32923a76944141e1ae48af764ba93fced;hp=70b857e1d4748a5958659c7a799d8dd33b4193d2;hb=9ff5b5165b2c8871bd4b29ccd5ca794638414615;hpb=59f85941934e85d4824c4d76e4d7ed3375bf2e3a diff --git a/include/fnetorderstream.h b/include/fnetorderstream.h index 70b857e..f58550b 100644 --- a/include/fnetorderstream.h +++ b/include/fnetorderstream.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: fnetorderstream.h,v 1.8 2001/01/28 19:10:18 kevin Exp $ +** $Id: fnetorderstream.h,v 1.9 2001/03/13 04:44:25 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -88,6 +88,29 @@ SwapBytes8 (void* buffer) p[4] = temp; } +inline void +SwapBytes2IfLittleEndian (void* buffer) +{ +#ifndef WORDS_BIGENDIAN + SwapBytes2 (buffer); +#endif +} + +inline void +SwapBytes4IfLittleEndian (void* buffer) +{ +#ifndef WORDS_BIGENDIAN + SwapBytes4 (buffer); +#endif +} + +inline void +SwapBytes8IfLittleEndian (void* buffer) +{ +#ifndef WORDS_BIGENDIAN + SwapBytes8 (buffer); +#endif +} void ConvertNetworkOrder (void* buffer, size_t bytes); void ConvertReverseNetworkOrder (void* buffer, size_t bytes);