typedefs.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. Copyright 2010-2016 Intel Corporation
  3. This software is licensed to you in accordance
  4. with the agreement between you and Intel Corporation.
  5. Alternatively, you can use this file in compliance
  6. with the Apache license, Version 2.
  7. Apache License, Version 2.0
  8. Licensed under the Apache License, Version 2.0 (the "License");
  9. you may not use this file except in compliance with the License.
  10. You may obtain a copy of the License at
  11. http://www.apache.org/licenses/LICENSE-2.0
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. */
  18. /**
  19. ********************************************************************************
  20. **
  21. ** @file typedefs.h
  22. **
  23. ** @brief Contains common type declarations used throughout the code
  24. **
  25. ** @author Ranjit Narjala
  26. **
  27. ********************************************************************************
  28. */
  29. #ifndef _TYPEDEFS_H_
  30. #define _TYPEDEFS_H_
  31. #include <stdint.h>
  32. #include <wchar.h>
  33. #ifdef _WIN32
  34. #include <windows.h>
  35. #endif
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. typedef uint8_t UINT8;
  40. typedef uint16_t UINT16;
  41. typedef uint32_t UINT32;
  42. typedef int8_t INT8;
  43. typedef int16_t INT16;
  44. typedef int32_t INT32;
  45. typedef void * PVOID;
  46. #ifdef _WIN32
  47. typedef wchar_t FILECHAR;
  48. #else
  49. typedef char TCHAR;
  50. typedef char FILECHAR;
  51. #define __declspec(x)
  52. #endif /* _WIN32 */
  53. #ifndef IN
  54. #define IN // Defines an input parameter
  55. #endif
  56. #ifndef OUT
  57. #define OUT // Defines an output parameter
  58. #endif
  59. #ifndef INOUT
  60. #define INOUT // Defines an input/output parameter
  61. #endif
  62. #ifndef TRUE
  63. #define TRUE 1 // True value for a BOOLEAN
  64. #endif
  65. #ifndef FALSE
  66. #define FALSE 0 // False value for a BOOLEAN
  67. #endif
  68. #ifdef __cplusplus
  69. } // extern "C"
  70. #endif
  71. #ifndef NULL
  72. #ifdef __cplusplus
  73. // Define NULL pointer value under C++
  74. #define NULL 0
  75. #else
  76. // Define NULL pointer value non-C++
  77. #define NULL ((void *)0)
  78. #endif
  79. #endif
  80. #endif // _TYPEDEFS_H