Changeset 671f0a3 in freewrt


Ignore:
Timestamp:
Jun 11, 2006, 11:52:34 PM (20 years ago)
Author:
Waldemar Brodkorb <wbx@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
abfbcd7
Parents:
22b2db8
Message:

add OpenBSD compatibility

git-svn-id: svn://www.freewrt.org/trunk/freewrt@52 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • target/utils/src/trx.c

    r22b2db8 r671f0a3  
    11/*
    22 * Copyright (C) 2004  Manuel Novoa III  <mjn3@codepoet.org>
     3 * Copyright (C) 2006  OpenWrt developers <openwrt-developers@openwrt.org>
    34 *
    45 * This program is free software; you can redistribute it and/or modify
     
    1718 */
    1819
    19 /* July 29, 2004
    20  *
    21  * This is a hacked replacement for the 'trx' utility used to create
    22  * wrt54g .trx firmware files.  It isn't pretty, but it does the job
    23  * for me.
    24  *
    25  * As an extension, you can specify a larger maximum length for the
    26  * .trx file using '-m'.  It will be rounded up to be a multiple of 4K.
    27  * NOTE: This space will be malloc()'d.
    28  *
    29  * August 16, 2004
    30  *
    31  * Sigh... Make it endian-neutral.
    32  *
    33  * TODO: Support '-b' option to specify offsets for each file.
    34  *
    35  * February 19, 2005 - mbm
    36  *
    37  * Add -a (align offset) and -b (absolute offset)
    38  */
    39 
    4020#include <stdio.h>
    4121#include <stdlib.h>
     
    4626#include <unistd.h>
    4727#if defined(__APPLE__)
    48 #include        <machine/endian.h>
    49 #include        <machine/byte_order.h>
     28#include <machine/endian.h>
     29#include <machine/byte_order.h>
    5030#define __BYTE_ORDER BYTE_ORDER
    5131#define __BIG_ENDIAN BIG_ENDIAN
     
    5333#define bswap_32(x) NXSwapInt(x)
    5434#define bswap_64(x) NXSwapLongLong(x)
     35#elif defined(__OpenBSD__)
     36#include <machine/endian.h>
     37#define bswap_16(x) swap16(x)
     38#define bswap_32(x) swap32(x)
     39#define bswap_64(x) swap64(x)
    5540#else
    5641#include <endian.h>
Note: See TracChangeset for help on using the changeset viewer.