This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SIM_ENDIAN_C_
#define _SIM_ENDIAN_C_
-#ifndef STATIC_INLINE_ENDIAN
-#define STATIC_INLINE_ENDIAN STATIC_INLINE
-#endif
-
-
#include "config.h"
#include "basics.h"
#define _SWAP_1(SET,RAW) SET (RAW)
#endif
-#if !defined(_SWAP_2) && (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) && WITH_NTOH
+#if !defined(_SWAP_2) && (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) && defined(htons)
#define _SWAP_2(SET,RAW) SET htons (RAW)
#endif
#define _SWAP_2(SET,RAW) SET (((RAW) >> 8) | ((RAW) << 8))
#endif
-#if !defined(_SWAP_4) && (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) && WITH_NTOH
+#if !defined(_SWAP_4) && (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) && defined(htonl)
#define _SWAP_4(SET,RAW) SET htonl (RAW)
#endif
SET out.dword;
#endif
-#undef N
#define N 1
#include "sim-endian-n.h"
-
#undef N
+
#define N 2
#include "sim-endian-n.h"
-
#undef N
+
#define N 4
#include "sim-endian-n.h"
-
#undef N
+
#define N 8
#include "sim-endian-n.h"
+#undef N
#endif /* _SIM_ENDIAN_C_ */