Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vcos_stdint.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef VCOS_STDINT_H
  26. #define VCOS_STDINT_H
  27. /** \file
  28. * Attempt to provide the types defined in stdint.h.
  29. *
  30. * Except for use with lcc, this simply includes stdint.h, which should find
  31. * the system/toolchain version if present, otherwise falling back to the
  32. * version in <platform>.
  33. */
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if defined (VCMODS_LCC)
  38. #include <limits.h>
  39. typedef signed char int8_t;
  40. typedef unsigned char uint8_t;
  41. typedef signed short int16_t;
  42. typedef unsigned short uint16_t;
  43. typedef signed long int32_t;
  44. typedef unsigned long uint32_t;
  45. typedef int32_t intptr_t;
  46. typedef uint32_t uintptr_t;
  47. typedef int32_t intmax_t;
  48. typedef uint32_t uintmax_t;
  49. typedef int8_t int_least8_t;
  50. typedef int16_t int_least16_t;
  51. typedef int32_t int_least32_t;
  52. typedef uint8_t uint_least8_t;
  53. typedef uint16_t uint_least16_t;
  54. typedef uint32_t uint_least32_t;
  55. #define INT8_MIN SCHAR_MIN
  56. #define INT8_MAX SCHAR_MAX
  57. #define UINT8_MAX UCHAR_MAX
  58. #define INT16_MIN SHRT_MIN
  59. #define INT16_MAX SHRT_MAX
  60. #define UINT16_MAX USHRT_MAX
  61. #define INT32_MIN LONG_MIN
  62. #define INT32_MAX LONG_MAX
  63. #define UINT32_MAX ULONG_MAX
  64. #define INTPTR_MIN INT32_MIN
  65. #define INTPTR_MAX INT32_MAX
  66. #define UINTPTR_MAX UINT32_MAX
  67. #define INTMAX_MIN INT32_MIN
  68. #define INTMAX_MAX INT32_MAX
  69. #define UINTMAX_MAX UINT32_MAX
  70. /* N.B. 64-bit integer types are not currently supported by lcc.
  71. * However, these symbols are referenced in header files included by files
  72. * compiled by lcc for VCE, so removing them would break the build.
  73. * The solution here then is to define them, as the correct size, but in a
  74. * way that should make them unusable in normal arithmetic operations.
  75. */
  76. typedef struct { uint32_t a; uint32_t b; } int64_t;
  77. typedef struct { uint32_t a; uint32_t b; } uint64_t;
  78. #else
  79. #include <stdint.h>
  80. #endif
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif /* VCOS_STDINT_H */