transactd 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/BUILD_UNIX-JA +46 -67
  3. data/BUILD_WIN-JA +106 -63
  4. data/CMakeLists.txt +40 -15
  5. data/README +219 -75
  6. data/README-JA +207 -76
  7. data/README_ORMSRCGEN +118 -0
  8. data/README_ORMSRCGEN-JA +115 -0
  9. data/bin/common/tdclc_32_2_0.dll +0 -0
  10. data/bin/common/tdclc_64_2_0.dll +0 -0
  11. data/build/common/check_for_link_iconv.cmake +18 -14
  12. data/build/common/create_symlink.cmake.in +25 -0
  13. data/build/common/get_boost_libs.cmake +23 -23
  14. data/build/common/options.cmake +0 -66
  15. data/build/common/smart_install.cmake +3 -3
  16. data/build/common/transactd.rc.in +15 -5
  17. data/build/common/transactd_cl_common.cmake +37 -18
  18. data/build/common/transactd_cl_output.cmake +55 -13
  19. data/build/common/transactd_common.cmake +108 -31
  20. data/build/swig/php/generate.cmake.in +15 -17
  21. data/build/swig/php/generate.cmd.in +15 -9
  22. data/build/swig/php/php.swg +124 -82
  23. data/build/swig/php/transactd.no_yield.php +4494 -0
  24. data/build/swig/php/transactd.no_yield.php.git.patch +685 -0
  25. data/build/swig/php/transactd.no_yield.php.patch +685 -0
  26. data/build/swig/php/transactd.yield.php +4461 -0
  27. data/build/swig/php/transactd.yield.php.git.patch +652 -0
  28. data/build/swig/php/transactd.yield.php.patch +652 -0
  29. data/build/swig/referencecounter.h +79 -0
  30. data/build/swig/ruby/ruby.swg +226 -76
  31. data/build/swig/ruby/threadBlockRegionWrapper.h +71 -0
  32. data/build/swig/ruby/without_gvl.swg +87 -0
  33. data/build/swig/tdcl.i +659 -170
  34. data/build/swig/validatablepointer.h +91 -0
  35. data/build/tdclc/CMakeLists.txt +49 -34
  36. data/build/tdclc/{tdclc_64.cbproj → tdclc.cbproj} +65 -20
  37. data/build/tdclc/tdclc.rc +0 -0
  38. data/build/tdclcpp/CMakeLists.txt +84 -20
  39. data/build/tdclcpp/tdclcpp.rc +0 -0
  40. data/build/tdclcpp/{tdclcpp_bcb_64.cbproj → tdclcpp_bc.cbproj} +168 -44
  41. data/build/tdclrb/CMakeLists.txt +84 -66
  42. data/build/tdclrb/bldgem/extconf.rb +28 -3
  43. data/build/tdclrb/gem/helper.rb +11 -1
  44. data/build/tdclrb/gem_output.cmake +20 -16
  45. data/index_ja.html +15 -0
  46. data/source/bzs/db/IBlobBuffer.h +15 -17
  47. data/source/bzs/db/blobBuffer.h +186 -140
  48. data/source/bzs/db/blobStructs.h +37 -37
  49. data/source/bzs/db/engine/mysql/IReadRecords.h +34 -34
  50. data/source/bzs/db/engine/mysql/bookmark.h +150 -147
  51. data/source/bzs/db/engine/mysql/database.cpp +1721 -1526
  52. data/source/bzs/db/engine/mysql/database.h +608 -370
  53. data/source/bzs/db/engine/mysql/dbManager.cpp +213 -201
  54. data/source/bzs/db/engine/mysql/dbManager.h +115 -104
  55. data/source/bzs/db/engine/mysql/errorMessage.cpp +49 -50
  56. data/source/bzs/db/engine/mysql/errorMessage.h +25 -26
  57. data/source/bzs/db/engine/mysql/fieldAccess.h +55 -61
  58. data/source/bzs/db/engine/mysql/mydebuglog.cpp +326 -292
  59. data/source/bzs/db/engine/mysql/mydebuglog.h +63 -55
  60. data/source/bzs/db/engine/mysql/mysqlInternal.h +182 -125
  61. data/source/bzs/db/engine/mysql/mysqlThd.cpp +121 -121
  62. data/source/bzs/db/engine/mysql/mysqlThd.h +20 -20
  63. data/source/bzs/db/engine/mysql/percentageKey.h +241 -228
  64. data/source/bzs/db/protocol/ICommandExecuter.h +18 -17
  65. data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +543 -514
  66. data/source/bzs/db/protocol/hs/hsCommandExecuter.h +155 -158
  67. data/source/bzs/db/protocol/tdap/btrDate.cpp +213 -180
  68. data/source/bzs/db/protocol/tdap/btrDate.h +39 -37
  69. data/source/bzs/db/protocol/tdap/client/activeTable.cpp +173 -0
  70. data/source/bzs/db/protocol/tdap/client/activeTable.h +165 -0
  71. data/source/bzs/db/protocol/tdap/client/activeTableImple.h +370 -0
  72. data/source/bzs/db/protocol/tdap/client/bulkInsert.h +13 -23
  73. data/source/bzs/db/protocol/tdap/client/client.cpp +81 -68
  74. data/source/bzs/db/protocol/tdap/client/client.h +361 -320
  75. data/source/bzs/db/protocol/tdap/client/connMgr.cpp +17 -22
  76. data/source/bzs/db/protocol/tdap/client/connMgr.h +17 -19
  77. data/source/bzs/db/protocol/tdap/client/connectionPool.cpp +243 -0
  78. data/source/bzs/db/protocol/tdap/client/connectionPool.h +109 -0
  79. data/source/bzs/db/protocol/tdap/client/database.cpp +327 -219
  80. data/source/bzs/db/protocol/tdap/client/database.h +141 -118
  81. data/source/bzs/db/protocol/tdap/client/databaseFactory.cpp +60 -62
  82. data/source/bzs/db/protocol/tdap/client/databaseManager.h +255 -0
  83. data/source/bzs/db/protocol/tdap/client/dbDef.cpp +315 -202
  84. data/source/bzs/db/protocol/tdap/client/dbDef.h +40 -32
  85. data/source/bzs/db/protocol/tdap/client/dllmain.cpp +390 -371
  86. data/source/bzs/db/protocol/tdap/client/errorMessage.cpp +148 -56
  87. data/source/bzs/db/protocol/tdap/client/errorMessage_ja.cpp +149 -57
  88. data/source/bzs/db/protocol/tdap/client/export.h +35 -0
  89. data/source/bzs/db/protocol/tdap/client/field.cpp +1985 -0
  90. data/source/bzs/db/protocol/tdap/client/field.h +393 -0
  91. data/source/bzs/db/protocol/tdap/client/fieldDDF.cpp +14 -14
  92. data/source/bzs/db/protocol/tdap/client/fieldDDF.h +11 -14
  93. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.cpp +123 -0
  94. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.h +58 -0
  95. data/source/bzs/db/protocol/tdap/client/fields.h +178 -0
  96. data/source/bzs/db/protocol/tdap/client/fileDDF.cpp +13 -16
  97. data/source/bzs/db/protocol/tdap/client/fileDDF.h +11 -17
  98. data/source/bzs/db/protocol/tdap/client/filter.h +423 -259
  99. data/source/bzs/db/protocol/tdap/client/groupComp.h +117 -0
  100. data/source/bzs/db/protocol/tdap/client/groupQuery.cpp +818 -0
  101. data/source/bzs/db/protocol/tdap/client/groupQuery.h +281 -0
  102. data/source/bzs/db/protocol/tdap/client/indexDDF.cpp +14 -17
  103. data/source/bzs/db/protocol/tdap/client/indexDDF.h +11 -14
  104. data/source/bzs/db/protocol/tdap/client/memRecord.cpp +231 -0
  105. data/source/bzs/db/protocol/tdap/client/memRecord.h +145 -0
  106. data/source/bzs/db/protocol/tdap/client/memRecordset.cpp +448 -0
  107. data/source/bzs/db/protocol/tdap/client/memRecordset.h +159 -0
  108. data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +300 -173
  109. data/source/bzs/db/protocol/tdap/client/nsDatabase.h +53 -36
  110. data/source/bzs/db/protocol/tdap/client/nsTable.cpp +171 -128
  111. data/source/bzs/db/protocol/tdap/client/nsTable.h +121 -87
  112. data/source/bzs/db/protocol/tdap/client/pooledDatabaseManager.h +173 -0
  113. data/source/bzs/db/protocol/tdap/client/recordset.cpp +209 -0
  114. data/source/bzs/db/protocol/tdap/client/recordset.h +86 -0
  115. data/source/bzs/db/protocol/tdap/client/recordsetImple.h +596 -0
  116. data/source/bzs/db/protocol/tdap/client/request.h +227 -170
  117. data/source/bzs/db/protocol/tdap/client/serializer.cpp +1288 -0
  118. data/source/bzs/db/protocol/tdap/client/serializer.h +295 -0
  119. data/source/bzs/db/protocol/tdap/client/sharedData.cpp +9 -12
  120. data/source/bzs/db/protocol/tdap/client/sharedData.h +18 -16
  121. data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +494 -473
  122. data/source/bzs/db/protocol/tdap/client/sqlBuilder.h +51 -53
  123. data/source/bzs/db/protocol/tdap/client/stringConverter.h +214 -148
  124. data/source/bzs/db/protocol/tdap/client/table.cpp +929 -1665
  125. data/source/bzs/db/protocol/tdap/client/table.h +413 -87
  126. data/source/bzs/db/protocol/tdap/client/trdboostapi.h +642 -534
  127. data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +25 -40
  128. data/source/bzs/db/protocol/tdap/client/trdclcppautolink.h +11 -15
  129. data/source/bzs/db/protocol/tdap/client/trdormapi.h +378 -437
  130. data/source/bzs/db/protocol/tdap/client/trnsctcl.def +1 -1
  131. data/source/bzs/db/protocol/tdap/fieldComp.h +127 -0
  132. data/source/bzs/db/protocol/tdap/myDateTime.cpp +352 -345
  133. data/source/bzs/db/protocol/tdap/mysql/characterset.cpp +75 -78
  134. data/source/bzs/db/protocol/tdap/mysql/characterset.h +18 -19
  135. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +216 -199
  136. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +23 -14
  137. data/source/bzs/db/protocol/tdap/mysql/debuglog.cpp +354 -314
  138. data/source/bzs/db/protocol/tdap/mysql/debuglog.h +57 -47
  139. data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +905 -739
  140. data/source/bzs/db/protocol/tdap/mysql/request.h +152 -159
  141. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +1044 -879
  142. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +87 -81
  143. data/source/bzs/db/protocol/tdap/tdapRequest.h +162 -130
  144. data/source/bzs/db/protocol/tdap/tdapSchema.cpp +368 -166
  145. data/source/bzs/db/protocol/tdap/tdapSchema.h +702 -566
  146. data/source/bzs/db/protocol/tdap/tdapcapi.h +387 -353
  147. data/source/bzs/db/transactd/appBuilderImple.h +21 -20
  148. data/source/bzs/db/transactd/appModule.cpp +350 -98
  149. data/source/bzs/db/transactd/appModule.h +31 -37
  150. data/source/bzs/db/transactd/connManager.cpp +138 -135
  151. data/source/bzs/db/transactd/connManager.h +28 -21
  152. data/source/bzs/db/transactd/connectionRecord.h +39 -39
  153. data/source/bzs/db/transactd/transactd.cpp +217 -203
  154. data/source/bzs/env/boost_bcb_link.h +131 -0
  155. data/source/bzs/env/compiler.h +136 -79
  156. data/source/bzs/env/crosscompile.cpp +57 -57
  157. data/source/bzs/env/crosscompile.h +130 -115
  158. data/source/bzs/env/fileopen.h +7 -8
  159. data/source/bzs/env/mbcswchrLinux.cpp +4 -9
  160. data/source/bzs/env/mbcswchrLinux.h +37 -34
  161. data/source/bzs/env/tcharMinGW.h +59 -0
  162. data/source/bzs/env/tstring.h +90 -95
  163. data/source/bzs/example/changeSchema.cpp +22 -23
  164. data/source/bzs/example/changeSchema_c.cpp +22 -24
  165. data/source/bzs/example/connection_pool_c.cpp +49 -104
  166. data/source/bzs/example/createDatabase.cpp +40 -47
  167. data/source/bzs/example/createDatabase_c.cpp +38 -43
  168. data/source/bzs/example/deleteRecords.cpp +10 -15
  169. data/source/bzs/example/deleteRecords_c.cpp +10 -14
  170. data/source/bzs/example/dropDatabase.cpp +3 -9
  171. data/source/bzs/example/dropDatabase_c.cpp +5 -6
  172. data/source/bzs/example/insertRecords.cpp +37 -29
  173. data/source/bzs/example/insertRecords_c.cpp +19 -25
  174. data/source/bzs/example/ormap_c.cpp +621 -0
  175. data/source/bzs/example/queryData.cpp +371 -0
  176. data/source/bzs/example/queryData.h +16 -0
  177. data/source/bzs/example/query_c.cpp +109 -0
  178. data/source/bzs/example/readRecords.cpp +27 -27
  179. data/source/bzs/example/readRecords_c.cpp +25 -23
  180. data/source/bzs/example/updateRecords.cpp +16 -21
  181. data/source/bzs/example/updateRecords_c.cpp +8 -12
  182. data/source/bzs/example/update_with_transaction.cpp +21 -24
  183. data/source/bzs/example/update_with_transaction_c.cpp +12 -15
  184. data/source/bzs/example/useORMRecord.cpp +177 -0
  185. data/source/bzs/netsvc/client/tcpClient.cpp +167 -156
  186. data/source/bzs/netsvc/client/tcpClient.h +541 -489
  187. data/source/bzs/netsvc/server/IAppModule.h +119 -32
  188. data/source/bzs/netsvc/server/iserver.h +21 -23
  189. data/source/bzs/netsvc/server/serverCpt.cpp +421 -391
  190. data/source/bzs/netsvc/server/serverCpt.h +41 -43
  191. data/source/bzs/netsvc/server/serverPipe.cpp +580 -565
  192. data/source/bzs/netsvc/server/serverPipe.h +44 -45
  193. data/source/bzs/netsvc/server/serverTpool.cpp +333 -303
  194. data/source/bzs/netsvc/server/serverTpool.h +38 -43
  195. data/source/bzs/rtl/benchmark.cpp +91 -31
  196. data/source/bzs/rtl/benchmark.h +76 -22
  197. data/source/bzs/rtl/datetime.cpp +231 -233
  198. data/source/bzs/rtl/datetime.h +16 -16
  199. data/source/bzs/rtl/debuglog.cpp +48 -51
  200. data/source/bzs/rtl/debuglog.h +55 -44
  201. data/source/bzs/rtl/exception.h +55 -48
  202. data/source/bzs/rtl/stl_uty.cpp +27 -28
  203. data/source/bzs/rtl/stl_uty.h +28 -29
  204. data/source/bzs/rtl/stringBuffers.cpp +8 -6
  205. data/source/bzs/rtl/stringBuffers.h +16 -9
  206. data/source/bzs/rtl/strtrim.cpp +90 -91
  207. data/source/bzs/rtl/strtrim.h +14 -16
  208. data/source/bzs/test/tdclatl/bench_query_atl.js +647 -0
  209. data/source/bzs/test/tdclatl/bench_tdclatl.js +303 -303
  210. data/source/bzs/test/tdclatl/test_query_atl.js +669 -0
  211. data/source/bzs/test/tdclphp/bench.php +357 -0
  212. data/source/bzs/test/tdclphp/transactd_Test.php +907 -303
  213. data/source/bzs/test/tdclphp/transactd_blob_Test.php +21 -49
  214. data/source/bzs/test/tdclphp/transactd_datetime_Test.php +41 -75
  215. data/source/bzs/test/tdclphp/transactd_kanjischema_Test.php +23 -37
  216. data/source/bzs/test/tdclphp/transactd_pool_Test.php +120 -0
  217. data/source/bzs/test/tdclrb/bench_tdclcpp.rb +4 -6
  218. data/source/bzs/test/tdclrb/prepare.rb +15 -12
  219. data/source/bzs/test/tdclrb/transactd_blob_spec.rb +29 -32
  220. data/source/bzs/test/tdclrb/transactd_datetime_spec.rb +0 -29
  221. data/source/bzs/test/tdclrb/transactd_kanjischema_spec.rb +18 -19
  222. data/source/bzs/test/tdclrb/transactd_pool_spec.rb +107 -0
  223. data/source/bzs/test/tdclrb/transactd_spec.rb +734 -142
  224. data/source/bzs/test/transactdBench/query_bench.cpp +156 -0
  225. data/source/bzs/test/transactdBench/scaling_bench.cpp +265 -0
  226. data/source/bzs/test/transactdBench/transactdBench.cpp +107 -83
  227. data/source/bzs/test/transactdBench/transactdBench2.cpp +122 -83
  228. data/source/bzs/test/transactdBench/workerBase.cpp +5 -0
  229. data/source/bzs/test/transactdBench/workerBase.h +88 -0
  230. data/source/bzs/test/transactdBench/workerMySQLImple.h +333 -0
  231. data/source/bzs/test/transactdBench/workerTransactdImple.h +201 -0
  232. data/source/bzs/test/trdclengn/test_blob.cpp +121 -73
  233. data/source/bzs/test/trdclengn/test_trdclengn.cpp +1244 -426
  234. data/source/global/ormsrcgen/confParam.h +80 -0
  235. data/source/global/ormsrcgen/fieldName.cpp +77 -0
  236. data/source/global/ormsrcgen/fieldName.h +43 -0
  237. data/source/global/ormsrcgen/main.cpp +196 -0
  238. data/source/global/ormsrcgen/srcgen.cpp +763 -0
  239. data/source/global/ormsrcgen/srcgen.h +72 -0
  240. data/source/global/ormsrcgen/template/fieldNameList_sample.txt +2 -0
  241. data/source/global/ormsrcgen/template/ormDataClass_template.cpp +48 -0
  242. data/source/global/ormsrcgen/template/ormDataClass_template.h +34 -0
  243. data/source/global/ormsrcgen/template/ormMapClass_template.cpp +51 -0
  244. data/source/global/ormsrcgen/template/ormMapClass_template.h +62 -0
  245. data/source/global/ormsrcgen/template/template.cnf +38 -0
  246. data/source/global/querystmts/querystmts.cpp +237 -0
  247. data/source/global/tdclatl/ConnectParams.cpp +77 -0
  248. data/source/global/tdclatl/ConnectParams.h +70 -0
  249. data/source/global/tdclatl/Database.cpp +132 -128
  250. data/source/global/tdclatl/Database.h +60 -49
  251. data/source/global/tdclatl/DbDef.cpp +68 -64
  252. data/source/global/tdclatl/DbDef.h +36 -36
  253. data/source/global/tdclatl/Field.cpp +12 -17
  254. data/source/global/tdclatl/Field.h +15 -12
  255. data/source/global/tdclatl/FieldDef.cpp +75 -36
  256. data/source/global/tdclatl/FieldDef.h +38 -19
  257. data/source/global/tdclatl/FieldDefs.cpp +74 -0
  258. data/source/global/tdclatl/FieldDefs.h +56 -0
  259. data/source/global/tdclatl/FieldNames.cpp +99 -0
  260. data/source/global/tdclatl/FieldNames.h +66 -0
  261. data/source/global/tdclatl/Flags.cpp +75 -37
  262. data/source/global/tdclatl/Flags.h +13 -12
  263. data/source/global/tdclatl/GroupQuery.cpp +119 -0
  264. data/source/global/tdclatl/GroupQuery.h +65 -0
  265. data/source/global/tdclatl/KeyDef.cpp +15 -14
  266. data/source/global/tdclatl/KeyDef.h +20 -17
  267. data/source/global/tdclatl/KeySegment.cpp +13 -12
  268. data/source/global/tdclatl/PooledDbManager.cpp +223 -0
  269. data/source/global/tdclatl/PooledDbManager.h +76 -0
  270. data/source/global/tdclatl/QueryBase.cpp +206 -127
  271. data/source/global/tdclatl/QueryBase.h +55 -59
  272. data/source/global/tdclatl/Record.cpp +214 -0
  273. data/source/global/tdclatl/Record.h +96 -0
  274. data/source/global/tdclatl/Recordset.cpp +278 -0
  275. data/source/global/tdclatl/Recordset.h +83 -0
  276. data/source/global/tdclatl/RecordsetQuery.cpp +118 -0
  277. data/source/global/tdclatl/RecordsetQuery.h +126 -0
  278. data/source/global/tdclatl/Table.cpp +57 -60
  279. data/source/global/tdclatl/Table.h +32 -29
  280. data/source/global/tdclatl/TableDef.cpp +63 -62
  281. data/source/global/tdclatl/TableDef.h +20 -22
  282. data/source/global/tdclatl/TdVersion.cpp +3 -3
  283. data/source/global/tdclatl/TdVersion.h +15 -11
  284. data/source/global/tdclatl/_IDatabaseEvents_CP.h +99 -92
  285. data/source/global/tdclatl/activeTable.cpp +355 -0
  286. data/source/global/tdclatl/activeTable.h +79 -0
  287. data/source/global/tdclatl/dllmain.cpp +4 -3
  288. data/source/global/tdclatl/dllmain.h +7 -6
  289. data/source/global/tdclatl/keySegment.h +22 -18
  290. data/source/global/tdclatl/resource.h +0 -0
  291. data/source/global/tdclatl/stdafx.h +6 -4
  292. data/source/global/tdclatl/targetver.h +0 -1
  293. data/source/global/tdclatl/tdclatl.cpp +10 -5
  294. data/source/global/tdclatl/tdclatl.idl +530 -14
  295. data/source/linux/charsetConvert.h +78 -79
  296. data/source/linux/linuxTypes.h +9 -12
  297. data/source/linux/tchar.h +168 -166
  298. data/transactd.gemspec +24 -16
  299. metadata +98 -12
  300. data/bin/common/tdclc_32_1_2.dll +0 -0
  301. data/bin/common/tdclc_64_1_2.dll +0 -0
  302. data/build/tdclc/tdclc_32.cbproj +0 -173
  303. data/build/tdclcpp/tdclcpp_bcb_32.cbproj +0 -232
  304. data/build/tdclrb/GEM_VERSION +0 -3
  305. data/source/bzs/db/protocol/tdap/client/filter.cpp +0 -43
  306. data/source/bzs/example/useORM.cpp +0 -585
@@ -1,5 +1,5 @@
1
- #ifndef BZS_ENV_COMPILER_H
2
- #define BZS_ENV_COMPILER_H
1
+ #ifndef BZS_ENV_COMPILER_H
2
+ #define BZS_ENV_COMPILER_H
3
3
  /*=================================================================
4
4
  Copyright (C) 2012 2013 BizStation Corp All rights reserved.
5
5
 
@@ -18,124 +18,181 @@
18
18
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
  02111-1307, USA.
20
20
  =================================================================*/
21
-
22
- #if (__BCPLUSPLUS__ && !defined(__clang__))
23
- # define __THREAD __thread
24
- # define __STDCALL __stdcall
21
+ // function type
22
+ #if (__BCPLUSPLUS__)
23
+ #if (defined(__APPLE__) || defined(__clang__))
24
+ #define __THREAD __declspec(thread)
25
+ #define __STDCALL
26
+ #else
27
+ #define __THREAD __thread
28
+ #define __STDCALL __stdcall
29
+ #endif
25
30
  #else
26
- # define __THREAD __declspec(thread)
27
- # if (_MSC_VER || (__BORLANDC__ && __clang__) || __MINGW32__)
28
- # define __STDCALL __stdcall
29
- # else
30
- # define __STDCALL
31
- # endif
31
+ #define __THREAD __declspec(thread)
32
+ #if (_MSC_VER || __MINGW32__)
33
+ #define __STDCALL __stdcall
34
+ #else
35
+ #define __STDCALL
36
+ #endif
32
37
  #endif
33
38
 
39
+ // operating system
34
40
  #ifdef _WIN32
35
- # ifdef _WIN64
36
- # ifndef __x86_64__
37
- # define __x86_64__
38
- # endif
39
- # else
40
- # define __x86_32__
41
- # endif
41
+ #ifdef _WIN64
42
+ #ifndef __x86_64__
43
+ #define __x86_64__
44
+ #endif
42
45
  #else
43
- # ifndef LINUX
44
- # define LINUX //Support 64bit only
45
- # endif
46
+ #define __x86_32__
46
47
  #endif
47
-
48
-
49
-
50
-
51
- #undef PACKAGE
52
-
48
+ #else
49
+ #ifndef LINUX
50
+ #define LINUX 1 // Support 64bit only
51
+ #endif
52
+ #endif
53
+ #if (__BCPLUSPLUS__ && defined(__APPLE__))
54
+ #define __APPLE_32__ 1
55
+ #endif
56
+ // thread strage
53
57
  #ifndef __THREAD_BCB
54
- # undef __THREAD
55
- # if (__BCPLUSPLUS__ && !defined(__clang__))
56
- # define __THREAD_BCB __thread
57
- # define __THREAD
58
- # else
59
- # define __THREAD_BCB
60
- # if (_MSC_VER || (__BORLANDC__ && __clang__))
61
- # define __THREAD __declspec(thread)
62
- # else
63
- # define __THREAD __thread
64
- # endif
65
- # endif
66
- #endif//__THREAD_BCB
58
+ #undef __THREAD
59
+ #if (__BCPLUSPLUS__ && !defined(__clang__))
60
+ #define __THREAD_BCB __thread
61
+ #define __THREAD
62
+ #else
63
+ #define __THREAD_BCB
64
+ #if (_MSC_VER || (__BORLANDC__ && __clang__))
65
+ #define __THREAD __declspec(thread)
66
+ #else
67
+ #define __THREAD __thread
68
+ #endif
69
+ #endif
70
+ #endif //__THREAD_BCB
67
71
 
72
+ // BCB_64
73
+ #if (__BCPLUSPLUS__ && defined(__clang__))
74
+ #define BCB_64
75
+ #endif
68
76
 
77
+ // BCB32
78
+ #if (__BCPLUSPLUS__ && defined(__x86_32__))
79
+ #define BCB_32
80
+ #endif
69
81
 
82
+ // export
83
+ #undef PACKAGE
70
84
  #ifdef __BCPLUSPLUS__
71
- # ifndef PACKAGE
72
- # ifdef __x86_64__
73
- # define PACKAGE __declspec(dllexport)
74
- # else
75
- # define PACKAGE __declspec(package)
76
- # endif
77
- # endif
85
+ #ifndef PACKAGE
86
+ #ifdef __x86_64__
87
+ #define PACKAGE __declspec(dllexport)
78
88
  #else
79
- # if (_WIN32 && !defined(__MINGW32__))
80
- # define PACKAGE __declspec(dllexport)
81
- # else
82
- # define PACKAGE
83
- # endif
89
+ #define PACKAGE __declspec(package)
90
+ #endif
91
+ #endif
92
+ #else
93
+ #if (_WIN32 && !defined(__MINGW32__))
94
+ #define PACKAGE __declspec(dllexport)
95
+ #else
96
+ #define PACKAGE
97
+ #endif
84
98
  #endif
85
-
86
99
 
87
100
  #ifdef PACKAGE_NO_EXPORT
88
- # undef PACKAGE
89
- # define PACKAGE
101
+ #undef PACKAGE
102
+ #define PACKAGE
90
103
  #endif
91
104
 
92
105
  #define AGRPACK PACKAGE
93
106
 
94
- // import
95
- #if (LINUX || __MINGW32__)
96
- # define PACKAGE_IMPORT
107
+ // bcb_osx
108
+ #if (__BCPLUSPLUS__ && defined(__APPLE__) && !defined(__clang__))
109
+ #define PACKAGE_OSX PACKAGE
97
110
  #else
98
- # define PACKAGE_IMPORT __declspec(dllimport)
111
+ #define PACKAGE_OSX
99
112
  #endif
100
113
 
114
+ // import
115
+ #if (defined(LINUX) || __MINGW32__)
116
+ #define PACKAGE_IMPORT
117
+ #else
118
+ #define PACKAGE_IMPORT __declspec(dllimport)
119
+ #endif
101
120
 
102
-
103
-
121
+ // data alignment
104
122
  #if (_MSC_VER || (__BORLANDC__ && __clang__))
105
- # define pragma_pack1 __pragma(pack(push, 1))
106
- # define pragma_pop __pragma(pack(pop))
123
+ #define pragma_pack1 __pragma(pack(push, 1))
124
+ #define pragma_pop __pragma(pack(pop))
107
125
  #else
108
- # ifdef __BCPLUSPLUS__
109
- # define pragma_pack1
110
- # define pragma_pop
111
- # else
112
- # define pragma_pack1 _Pragma("pack(1)")
113
- # define pragma_pop _Pragma("pack()")
114
- # endif
126
+ #ifdef __BCPLUSPLUS__
127
+ #define pragma_pack1
128
+ #define pragma_pop
129
+ #else
130
+ #define pragma_pack1 _Pragma("pack(1)")
131
+ #define pragma_pop _Pragma("pack()")
132
+ #endif
115
133
  #endif
116
134
 
117
- #if (_MSC_VER == 1600)
118
- # define COMPILER_VERSTR "vc100"
135
+ // compiler name
136
+ #if (_MSC_VER == 1600)
137
+ #define COMPILER_VERSTR "vc100"
119
138
  #endif
120
139
 
121
140
  #if (_MSC_VER == 1700)
122
- # define COMPILER_VERSTR "vc110"
141
+ #define COMPILER_VERSTR "vc110"
142
+ #endif
143
+
144
+ #if (_MSC_VER == 1800)
145
+ #define COMPILER_VERSTR "vc120"
123
146
  #endif
124
147
 
125
148
  #if (__BCPLUSPLUS__ >= 0x630 && (__BCPLUSPLUS__ < 0x640))
126
- # define COMPILER_VERSTR "bcb"
149
+ #define COMPILER_VERSTR "bc150"
127
150
  #endif
128
151
 
129
152
  #if (__BCPLUSPLUS__ >= 0x640 && (__BCPLUSPLUS__ < 0x650))
130
- # define COMPILER_VERSTR "bcb"
153
+ #define COMPILER_VERSTR "bc160"
131
154
  #endif
132
155
 
133
156
  #if (__BCPLUSPLUS__ >= 0x650 && (__BCPLUSPLUS__ < 0x660))
134
- # define COMPILER_VERSTR "bcb"
157
+ #define COMPILER_VERSTR "bc170"
135
158
  #endif
136
159
 
137
160
  #if (__BCPLUSPLUS__ >= 0x660 && (__BCPLUSPLUS__ < 0x670))
138
- # define COMPILER_VERSTR "bcb"
161
+ #define COMPILER_VERSTR "bc180"
162
+ #endif
163
+
164
+ #if (__BCPLUSPLUS__ >= 0x670 && (__BCPLUSPLUS__ < 0x680))
165
+ #define COMPILER_VERSTR "bc190"
166
+ #endif
167
+
168
+ #if (__BCPLUSPLUS__ >= 0x680 && (__BCPLUSPLUS__ < 0x690))
169
+ #define COMPILER_VERSTR "bc200"
170
+ #endif
171
+
172
+ #if (__BCPLUSPLUS__ >= 0x690 && (__BCPLUSPLUS__ < 0x700))
173
+ #define COMPILER_VERSTR "bc210"
174
+ #endif
175
+
176
+ #if (__APPLE__)
177
+ #define SHARED_LIB_EXTENTION ".dylib"
178
+ #else
179
+ #if (defined(LINUX) || (__BORLANDC__ && __clang__))
180
+ #define SHARED_LIB_EXTENTION ".a"
181
+ #else
182
+ #define SHARED_LIB_EXTENTION ".lib"
183
+ #endif
184
+ #endif
185
+
186
+ #if (defined(LINUX) || (__BORLANDC__ && __clang__))
187
+ #define LIB_EXTENTION ".a"
188
+ #else
189
+ #define LIB_EXTENTION ".lib"
190
+ #endif
191
+
192
+ #ifdef LINUX
193
+ #define LIB_PREFIX "lib"
194
+ #else
195
+ #define LIB_PREFIX
139
196
  #endif
140
197
 
141
- #endif//BZS_ENV_COMPILER_H
198
+ #endif // BZS_ENV_COMPILER_H
@@ -12,8 +12,8 @@
12
12
  GNU General Public License for more details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
15
+ along with this program; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
17
  02111-1307, USA.
18
18
  =================================================================*/
19
19
  #ifdef LINUX
@@ -23,108 +23,108 @@
23
23
  #include <wctype.h>
24
24
  #include <wchar.h>
25
25
 
26
-
27
26
  char16_t* _strupr16(char16_t* s)
28
27
  {
29
- char16_t* p = s;
30
- while (*s)
31
- {
32
- *s = towupper(*s);
33
- ++s;
34
- }
35
- return p;
28
+ char16_t* p = s;
29
+ while (*s)
30
+ {
31
+ *s = towupper(*s);
32
+ ++s;
33
+ }
34
+ return p;
36
35
  }
37
36
 
38
37
  char16_t* _strlwr16(char16_t* s)
39
38
  {
40
- char16_t* p = s;
41
- while (*s)
42
- {
43
- *s = towlower(*s);
44
- ++s;
45
- }
46
- return p;
39
+ char16_t* p = s;
40
+ while (*s)
41
+ {
42
+ *s = towlower(*s);
43
+ ++s;
44
+ }
45
+ return p;
47
46
  }
48
47
 
49
48
  char* _strupr(char* s)
50
49
  {
51
- char* p = s;
52
- while (*s)
53
- {
54
- *s = toupper(*s);
55
- ++s;
56
- }
57
- return p;
50
+ char* p = s;
51
+ while (*s)
52
+ {
53
+ *s = toupper(*s);
54
+ ++s;
55
+ }
56
+ return p;
58
57
  }
59
58
 
60
59
  char* _strlwr(char* s)
61
60
  {
62
- char* p = s;
63
- while (*s)
64
- {
65
- *s = tolower(*s);
66
- ++s;
67
- }
68
- return p;
61
+ char* p = s;
62
+ while (*s)
63
+ {
64
+ *s = tolower(*s);
65
+ ++s;
66
+ }
67
+ return p;
69
68
  }
70
69
 
71
70
  char* _i64toa_s(__int64 v, char* tmp, unsigned long size, int radix)
72
71
  {
73
- snprintf(tmp,size, "%Ld", v);
74
- return tmp;
72
+ snprintf(tmp, size, "%lld", v);
73
+ return tmp;
75
74
  }
76
75
 
77
76
  char* _ltoa_s(int v, char* tmp, unsigned long size, int radix)
78
77
  {
79
- snprintf(tmp,size, "%d", v);
80
- return tmp;
78
+ snprintf(tmp, size, "%d", v);
79
+ return tmp;
81
80
  }
82
81
 
83
- int wcsnicmp16(const char16_t *sl, const char16_t *sr, size_t n)
82
+ int wcsnicmp16(const char16_t* sl, const char16_t* sr, size_t n)
84
83
  {
85
- if (n == 0) return 0;
84
+ if (n == 0)
85
+ return 0;
86
86
  while (*sl)
87
87
  {
88
- wchar_t tmpl = towlower(*sl);
89
- wchar_t tmpr = towlower(*sr);
90
-
88
+ wchar_t tmpl = towlower(*sl);
89
+ wchar_t tmpr = towlower(*sr);
90
+
91
91
  if (tmpl != tmpr)
92
- return (int)(tmpl - tmpr);
93
- if (--n == 0) return 0;
92
+ return (int)(tmpl - tmpr);
93
+ if (--n == 0)
94
+ return 0;
94
95
  ++sl;
95
96
  ++sr;
96
97
  }
97
98
  return 0 - *sr;
98
99
  }
99
100
 
100
- int wcsncmp16(const char16_t *sl, const char16_t *sr, size_t n)
101
+ int wcsncmp16(const char16_t* sl, const char16_t* sr, size_t n)
101
102
  {
102
- if (n == 0) return 0;
103
+ if (n == 0)
104
+ return 0;
103
105
  while (*sl)
104
106
  {
105
107
  if (*sl != *sr)
106
- return (int)(*sl - *sr);
107
- if (--n == 0) return 0;
108
+ return (int)(*sl - *sr);
109
+ if (--n == 0)
110
+ return 0;
108
111
  ++sl;
109
112
  ++sr;
110
113
  }
111
114
  return 0 - *sr;
112
115
  }
113
116
 
114
- char16_t* wmemset16(char16_t* p , char16_t c, size_t n)
117
+ char16_t* wmemset16(char16_t* p, char16_t c, size_t n)
115
118
  {
116
- char16_t* end = p + n;
117
- for (char16_t* tmp = p; tmp < end; ++tmp)
118
- *tmp = c;
119
- return p;
119
+ char16_t* end = p + n;
120
+ for (char16_t* tmp = p; tmp < end; ++tmp)
121
+ *tmp = c;
122
+ return p;
120
123
  }
121
124
 
122
125
  char16_t* wmemcpy(char16_t* dest, const char16_t* src, size_t count)
123
126
  {
124
- return (char16_t*)memcpy(dest, src, count*sizeof(char16_t));
125
- }
126
-
127
-
128
- #endif //LINUX
129
-
127
+ return (char16_t*)memcpy(dest, src, count * sizeof(char16_t));
128
+ }
130
129
 
130
+ #endif // LINUX