Changeset 776f2e6 in mainline for uspace/lib/libc/include/byteorder.h


Ignore:
Timestamp:
2008-04-03T20:46:47Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12ab886
Parents:
5d494b3
Message:

Replace all endian.h in uspace with a copy of the kernel's respective byteorder.h.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_ENDIAN_H_
    36 #define LIBC_ENDIAN_H_
     35#ifndef LIBC_BYTEORDER_H_
     36#define LIBC_BYTEORDER_H_
    3737
    38 #define __LITTLE_ENDIAN 1234
    39 #define __BIG_ENDIAN    4321
     38#include <libarch/byteorder.h>
     39#include <stdint.h>
    4040
    41 #include <stdint.h>
    42 #include <libarch/endian.h>
     41#if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN))
     42#error The architecture must be either big-endian or little-endian.
     43#endif
    4344
    44 #if (__BYTE_ORDER == __BIG_ENDIAN)
     45#ifdef ARCH_IS_BIG_ENDIAN
    4546
    4647#define uint16_t_le2host(n)             uint16_t_byteorder_swap(n)
     
    6364
    6465#endif
    65 
    6666
    6767static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
Note: See TracChangeset for help on using the changeset viewer.