util_types.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /* ----------------------------------------------------------------- */
  2. /* The HMM-Based Singing Voice Synthesis System "Sinsy" */
  3. /* developed by Sinsy Working Group */
  4. /* http://sinsy.sourceforge.net/ */
  5. /* ----------------------------------------------------------------- */
  6. /* */
  7. /* Copyright (c) 2009-2015 Nagoya Institute of Technology */
  8. /* Department of Computer Science */
  9. /* */
  10. /* All rights reserved. */
  11. /* */
  12. /* Redistribution and use in source and binary forms, with or */
  13. /* without modification, are permitted provided that the following */
  14. /* conditions are met: */
  15. /* */
  16. /* - Redistributions of source code must retain the above copyright */
  17. /* notice, this list of conditions and the following disclaimer. */
  18. /* - Redistributions in binary form must reproduce the above */
  19. /* copyright notice, this list of conditions and the following */
  20. /* disclaimer in the documentation and/or other materials provided */
  21. /* with the distribution. */
  22. /* - Neither the name of the Sinsy working group nor the names of */
  23. /* its contributors may be used to endorse or promote products */
  24. /* derived from this software without specific prior written */
  25. /* permission. */
  26. /* */
  27. /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
  28. /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  29. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  30. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  31. /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
  32. /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
  33. /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
  34. /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
  35. /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
  36. /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
  37. /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
  38. /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  39. /* POSSIBILITY OF SUCH DAMAGE. */
  40. /* ----------------------------------------------------------------- */
  41. #ifndef SINSY_UTIL_TYPES_H_
  42. #define SINSY_UTIL_TYPES_H_
  43. namespace sinsy
  44. {
  45. #ifndef INT8
  46. #ifdef _WIN32
  47. typedef __int8 INT8;
  48. #elif (SIZEOF_CHAR==1)
  49. typedef char INT8;
  50. #elif (SIZEOF_SHORT==1)
  51. typedef short INT8;
  52. #elif (SIZEOF_INT==1)
  53. typedef int INT8;
  54. #elif (SIZEOF_LONG==1)
  55. typedef long INT8;
  56. #elif (SIZEOF_LONG_LONG==1)
  57. typedef long long INT8;
  58. #else
  59. typedef char INT8;
  60. #endif
  61. #endif
  62. #ifndef UINT8
  63. #ifdef _WIN32
  64. typedef unsigned __int8 UINT8;
  65. #elif (SIZEOF_UNSIGNED_CHAR==1)
  66. typedef unsigned char UINT8;
  67. #elif (SIZEOF_UNSIGNED_SHORT==1)
  68. typedef unsigned short UINT8;
  69. #elif (SIZEOF_UNSIGNED_INT==1)
  70. typedef unsigned int UINT8;
  71. #elif (SIZEOF_UNSIGNED_LONG==1)
  72. typedef unsigned long UINT8;
  73. #elif (SIZEOF_UNSIGNED_LONG_LONG==1)
  74. typedef unsigned long long UINT8;
  75. #else
  76. typedef unsigned char UINT8;
  77. #endif
  78. #endif
  79. #ifndef INT16
  80. #ifdef _WIN32
  81. typedef __int16 INT16;
  82. #elif (SIZEOF_CHAR==2)
  83. typedef char INT16;
  84. #elif (SIZEOF_SHORT==2)
  85. typedef short INT16;
  86. #elif (SIZEOF_INT==2)
  87. typedef int INT16;
  88. #elif (SIZEOF_LONG==2)
  89. typedef long INT16;
  90. #elif (SIZEOF_LONG_LONG==2)
  91. typedef long long INT16;
  92. #else
  93. typedef short INT16;
  94. #endif
  95. #endif
  96. #ifndef UINT16
  97. #ifdef _WIN32
  98. typedef unsigned __int16 UINT16;
  99. #elif (SIZEOF_UNSIGNED_CHAR==2)
  100. typedef unsigned char UINT16;
  101. #elif (SIZEOF_UNSIGNED_SHORT==2)
  102. typedef unsigned short UINT16;
  103. #elif (SIZEOF_UNSIGNED_INT==2)
  104. typedef unsigned int UINT16;
  105. #elif (SIZEOF_UNSIGNED_LONG==2)
  106. typedef unsigned long UINT16;
  107. #elif (SIZEOF_UNSIGNED_LONG_LONG==2)
  108. typedef unsigned long long UINT16;
  109. #else
  110. typedef unsigned short UINT16;
  111. #endif
  112. #endif
  113. #ifndef INT32
  114. #ifdef _WIN32
  115. typedef __int32 INT32;
  116. #elif (SIZEOF_CHAR==4)
  117. typedef char INT32;
  118. #elif (SIZEOF_SHORT==4)
  119. typedef short INT32;
  120. #elif (SIZEOF_INT==4)
  121. typedef int INT32;
  122. #elif (SIZEOF_LONG==4)
  123. typedef long INT32;
  124. #elif (SIZEOF_LONG_LONG==4)
  125. typedef long long INT32;
  126. #else
  127. typedef int INT32;
  128. #endif
  129. #endif
  130. #ifndef UINT32
  131. #ifdef _WIN32
  132. typedef unsigned __int32 UINT32;
  133. #elif (SIZEOF_UNSIGNED_CHAR==4)
  134. typedef unsigned char UINT32;
  135. #elif (SIZEOF_UNSIGNED_SHORT==4)
  136. typedef unsigned short UINT32;
  137. #elif (SIZEOF_UNSIGNED_INT==4)
  138. typedef unsigned int UINT32;
  139. #elif (SIZEOF_UNSIGNED_LONG==4)
  140. typedef unsigned long UINT32;
  141. #elif (SIZEOF_UNSIGNED_LONG_LONG==4)
  142. typedef unsigned long long UINT32;
  143. #else
  144. typedef unsigned int UINT32;
  145. #endif
  146. #endif
  147. #ifndef INT64
  148. #ifdef _WIN32
  149. typedef __int64 INT64;
  150. #elif (SIZEOF_CHAR==8)
  151. typedef char INT64;
  152. #elif (SIZEOF_SHORT==8)
  153. typedef short INT64;
  154. #elif (SIZEOF_INT==8)
  155. typedef int INT64;
  156. #elif (SIZEOF_LONG==8)
  157. typedef long INT64;
  158. #elif (SIZEOF_LONG_LONG==8)
  159. typedef long long INT64;
  160. #else
  161. typedef long long INT64;
  162. #endif
  163. #endif
  164. #ifndef UINT64
  165. #ifdef _WIN32
  166. typedef unsigned __int64 UINT64;
  167. #elif (SIZEOF_UNSIGNED_CHAR==8)
  168. typedef unsigned char UINT64;
  169. #elif (SIZEOF_UNSIGNED_SHORT==8)
  170. typedef unsigned short UINT64;
  171. #elif (SIZEOF_UNSIGNED_INT==8)
  172. typedef unsigned int UINT64;
  173. #elif (SIZEOF_UNSIGNED_LONG==8)
  174. typedef unsigned long UINT64;
  175. #elif (SIZEOF_UNSIGNED_LONG_LONG==8)
  176. typedef unsigned long long UINT64;
  177. #else
  178. typedef unsigned long long UINT64;
  179. #endif
  180. #endif
  181. }; // sinsy
  182. #endif // SINSY_UTIL_TYPES_H_