Ignore:
Timestamp:
Apr 24, 2006, 11:09:06 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed htons/htonl to hton16/hton32 to avoid useless conflicts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/common.h

    r863 r865  
    3333#endif
    3434
    35 #if !defined(HAVE_HTONS) && !defined(HAVE_NETINET_IN_H)
     35#if defined(HAVE_HTONS)
     36#   define hton16 htons
     37#   define hton32 htonl
     38#else
    3639#   if defined(HAVE_ENDIAN_H)
    3740#       include <endian.h>
    3841#   endif
    39 static inline uint16_t htons(uint16_t x)
     42static inline uint16_t hton16(uint16_t x)
    4043{
     44    /* This is compile-time optimised with at least -O1 or -Os */
    4145#if defined(HAVE_ENDIAN_H)
    4246    if(__BYTE_ORDER == __BIG_ENDIAN)
    4347#else
    44     /* This is compile-time optimised with at least -O1 or -Os */
    4548    uint32_t const dummy = 0x12345678;
    4649    if(*(uint8_t const *)&dummy == 0x12)
     
    5154}
    5255
    53 static inline uint32_t htonl(uint32_t x)
     56static inline uint32_t hton32(uint32_t x)
    5457{
     58    /* This is compile-time optimised with at least -O1 or -Os */
    5559#if defined(HAVE_ENDIAN_H)
    5660    if(__BYTE_ORDER == __BIG_ENDIAN)
    5761#else
    58     /* This is compile-time optimised with at least -O1 or -Os */
    5962    uint32_t const dummy = 0x12345678;
    6063    if(*(uint8_t const *)&dummy == 0x12)
Note: See TracChangeset for help on using the changeset viewer.