ijksdl_endian.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*****************************************************************************
  2. * ijksdl_endian.h
  3. *****************************************************************************
  4. *
  5. * Copyright (c) 2013 Bilibili
  6. * copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
  7. *
  8. * This file is part of ijkPlayer.
  9. *
  10. * ijkPlayer is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * ijkPlayer is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with ijkPlayer; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. #ifndef IJKSDL__IJKSDL_ENDIAN_H
  25. #define IJKSDL__IJKSDL_ENDIAN_H
  26. #define SDL_LIL_ENDIAN 1234
  27. #define SDL_BIG_ENDIAN 4321
  28. #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
  29. #ifdef __linux__
  30. #include <endian.h>
  31. #define SDL_BYTEORDER __BYTE_ORDER
  32. #else /* __linux __ */
  33. #if defined(__hppa__) || \
  34. defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
  35. (defined(__MIPS__) && defined(__MISPEB__)) || \
  36. defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
  37. defined(__sparc__)
  38. #define SDL_BYTEORDER SDL_BIG_ENDIAN
  39. #else
  40. #define SDL_BYTEORDER SDL_LIL_ENDIAN
  41. #endif
  42. #endif /* __linux __ */
  43. #endif /* !SDL_BYTEORDER */
  44. #endif