koffi 0.9.19 → 0.9.22

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 (266) hide show
  1. package/CMakeLists.txt +1 -57
  2. package/README.md +10 -7
  3. package/benchmark/build.sh +13 -0
  4. package/benchmark/raylib_c +0 -0
  5. package/benchmark/raylib_c.c +83 -0
  6. package/benchmark/raylib_koffi.js +127 -0
  7. package/benchmark/raylib_node_ffi.js +144 -0
  8. package/package.json +4 -2
  9. package/src/call_arm32.cc +5 -8
  10. package/src/call_arm64.cc +14 -1
  11. package/src/call_arm64_fwd.S +18 -12
  12. package/src/call_x64_sysv.cc +5 -4
  13. package/src/ffi.cc +26 -38
  14. package/src/util.hh +5 -3
  15. package/test/registry/machines.json +51 -11
  16. package/test/registry/sha256sum.txt +4 -4
  17. package/test/test.js +38 -20
  18. package/test/tests/misc.c +38 -3
  19. package/test/tests/misc.js +8 -1
  20. package/test/tests/raylib.js +1 -1
  21. package/test/tests/sqlite.js +1 -1
  22. package/vendor/raylib/src/external/glfw/src/posix_time.c +3 -1
  23. package/vendor/raylib/src/external/glfw/src/wl_init.c +3 -1
  24. package/vendor/raylib/projects/VS2019/examples/audio_module_playing.vcxproj +0 -387
  25. package/vendor/raylib/projects/VS2019/examples/audio_multichannel_sound.vcxproj +0 -387
  26. package/vendor/raylib/projects/VS2019/examples/audio_music_stream.vcxproj +0 -387
  27. package/vendor/raylib/projects/VS2019/examples/audio_raw_stream.vcxproj +0 -387
  28. package/vendor/raylib/projects/VS2019/examples/audio_sound_loading.vcxproj +0 -387
  29. package/vendor/raylib/projects/VS2019/examples/core_2d_camera.vcxproj +0 -387
  30. package/vendor/raylib/projects/VS2019/examples/core_2d_camera_platformer.vcxproj +0 -387
  31. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_first_person.vcxproj +0 -387
  32. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_free.vcxproj +0 -387
  33. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_mode.vcxproj +0 -387
  34. package/vendor/raylib/projects/VS2019/examples/core_3d_picking.vcxproj +0 -387
  35. package/vendor/raylib/projects/VS2019/examples/core_basic_window.vcxproj +0 -387
  36. package/vendor/raylib/projects/VS2019/examples/core_custom_logging.vcxproj +0 -387
  37. package/vendor/raylib/projects/VS2019/examples/core_drop_files.vcxproj +0 -387
  38. package/vendor/raylib/projects/VS2019/examples/core_input_gamepad.vcxproj +0 -387
  39. package/vendor/raylib/projects/VS2019/examples/core_input_gestures.vcxproj +0 -387
  40. package/vendor/raylib/projects/VS2019/examples/core_input_keys.vcxproj +0 -387
  41. package/vendor/raylib/projects/VS2019/examples/core_input_mouse.vcxproj +0 -387
  42. package/vendor/raylib/projects/VS2019/examples/core_input_mouse_wheel.vcxproj +0 -387
  43. package/vendor/raylib/projects/VS2019/examples/core_input_multitouch.vcxproj +0 -387
  44. package/vendor/raylib/projects/VS2019/examples/core_loading_thread.vcxproj +0 -387
  45. package/vendor/raylib/projects/VS2019/examples/core_quat_conversion.vcxproj +0 -387
  46. package/vendor/raylib/projects/VS2019/examples/core_random_values.vcxproj +0 -387
  47. package/vendor/raylib/projects/VS2019/examples/core_scissor_test.vcxproj +0 -387
  48. package/vendor/raylib/projects/VS2019/examples/core_split_screen.vcxproj +0 -387
  49. package/vendor/raylib/projects/VS2019/examples/core_storage_values.vcxproj +0 -387
  50. package/vendor/raylib/projects/VS2019/examples/core_vr_simulator.vcxproj +0 -387
  51. package/vendor/raylib/projects/VS2019/examples/core_window_flags.vcxproj +0 -387
  52. package/vendor/raylib/projects/VS2019/examples/core_window_letterbox.vcxproj +0 -387
  53. package/vendor/raylib/projects/VS2019/examples/core_world_screen.vcxproj +0 -387
  54. package/vendor/raylib/projects/VS2019/examples/easings_testbed.vcxproj +0 -387
  55. package/vendor/raylib/projects/VS2019/examples/embedded_files_loading.vcxproj +0 -387
  56. package/vendor/raylib/projects/VS2019/examples/models_animation.vcxproj +0 -387
  57. package/vendor/raylib/projects/VS2019/examples/models_billboard.vcxproj +0 -387
  58. package/vendor/raylib/projects/VS2019/examples/models_box_collisions.vcxproj +0 -387
  59. package/vendor/raylib/projects/VS2019/examples/models_cubicmap.vcxproj +0 -387
  60. package/vendor/raylib/projects/VS2019/examples/models_first_person_maze.vcxproj +0 -387
  61. package/vendor/raylib/projects/VS2019/examples/models_geometric_shapes.vcxproj +0 -387
  62. package/vendor/raylib/projects/VS2019/examples/models_heightmap.vcxproj +0 -387
  63. package/vendor/raylib/projects/VS2019/examples/models_loading.vcxproj +0 -387
  64. package/vendor/raylib/projects/VS2019/examples/models_loading_gltf.vcxproj +0 -387
  65. package/vendor/raylib/projects/VS2019/examples/models_loading_vox.vcxproj +0 -387
  66. package/vendor/raylib/projects/VS2019/examples/models_mesh_generation.vcxproj +0 -387
  67. package/vendor/raylib/projects/VS2019/examples/models_mesh_picking.vcxproj +0 -387
  68. package/vendor/raylib/projects/VS2019/examples/models_orthographic_projection.vcxproj +0 -387
  69. package/vendor/raylib/projects/VS2019/examples/models_rlgl_solar_system.vcxproj +0 -387
  70. package/vendor/raylib/projects/VS2019/examples/models_skybox.vcxproj +0 -387
  71. package/vendor/raylib/projects/VS2019/examples/models_waving_cubes.vcxproj +0 -387
  72. package/vendor/raylib/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj +0 -387
  73. package/vendor/raylib/projects/VS2019/examples/physics_demo.vcxproj +0 -387
  74. package/vendor/raylib/projects/VS2019/examples/physics_friction.vcxproj +0 -387
  75. package/vendor/raylib/projects/VS2019/examples/physics_movement.vcxproj +0 -387
  76. package/vendor/raylib/projects/VS2019/examples/physics_restitution.vcxproj +0 -387
  77. package/vendor/raylib/projects/VS2019/examples/physics_shatter.vcxproj +0 -387
  78. package/vendor/raylib/projects/VS2019/examples/raudio_standalone.vcxproj +0 -387
  79. package/vendor/raylib/projects/VS2019/examples/rlgl_standalone.vcxproj +0 -391
  80. package/vendor/raylib/projects/VS2019/examples/shaders_basic_lighting.vcxproj +0 -387
  81. package/vendor/raylib/projects/VS2019/examples/shaders_custom_uniform.vcxproj +0 -387
  82. package/vendor/raylib/projects/VS2019/examples/shaders_eratosthenes.vcxproj +0 -387
  83. package/vendor/raylib/projects/VS2019/examples/shaders_fog.vcxproj +0 -387
  84. package/vendor/raylib/projects/VS2019/examples/shaders_hot_reloading.vcxproj +0 -387
  85. package/vendor/raylib/projects/VS2019/examples/shaders_julia_set.vcxproj +0 -387
  86. package/vendor/raylib/projects/VS2019/examples/shaders_mesh_instancing.vcxproj +0 -387
  87. package/vendor/raylib/projects/VS2019/examples/shaders_model_shader.vcxproj +0 -387
  88. package/vendor/raylib/projects/VS2019/examples/shaders_multi_sample2d.vcxproj +0 -387
  89. package/vendor/raylib/projects/VS2019/examples/shaders_palette_switch.vcxproj +0 -387
  90. package/vendor/raylib/projects/VS2019/examples/shaders_postprocessing.vcxproj +0 -387
  91. package/vendor/raylib/projects/VS2019/examples/shaders_raymarching.vcxproj +0 -387
  92. package/vendor/raylib/projects/VS2019/examples/shaders_shapes_textures.vcxproj +0 -387
  93. package/vendor/raylib/projects/VS2019/examples/shaders_simple_mask.vcxproj +0 -387
  94. package/vendor/raylib/projects/VS2019/examples/shaders_spotlight.vcxproj +0 -387
  95. package/vendor/raylib/projects/VS2019/examples/shaders_texture_drawing.vcxproj +0 -387
  96. package/vendor/raylib/projects/VS2019/examples/shaders_texture_waves.vcxproj +0 -387
  97. package/vendor/raylib/projects/VS2019/examples/shapes_basic_shapes.vcxproj +0 -387
  98. package/vendor/raylib/projects/VS2019/examples/shapes_bouncing_ball.vcxproj +0 -387
  99. package/vendor/raylib/projects/VS2019/examples/shapes_collision_area.vcxproj +0 -387
  100. package/vendor/raylib/projects/VS2019/examples/shapes_colors_palette.vcxproj +0 -387
  101. package/vendor/raylib/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj +0 -387
  102. package/vendor/raylib/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj +0 -387
  103. package/vendor/raylib/projects/VS2019/examples/shapes_draw_ring.vcxproj +0 -387
  104. package/vendor/raylib/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj +0 -387
  105. package/vendor/raylib/projects/VS2019/examples/shapes_easings_box_anim.vcxproj +0 -387
  106. package/vendor/raylib/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj +0 -387
  107. package/vendor/raylib/projects/VS2019/examples/shapes_following_eyes.vcxproj +0 -387
  108. package/vendor/raylib/projects/VS2019/examples/shapes_lines_bezier.vcxproj +0 -387
  109. package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib.vcxproj +0 -387
  110. package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj +0 -387
  111. package/vendor/raylib/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj +0 -387
  112. package/vendor/raylib/projects/VS2019/examples/shapes_top_down_lights.vcxproj +0 -387
  113. package/vendor/raylib/projects/VS2019/examples/text_font_filters.vcxproj +0 -387
  114. package/vendor/raylib/projects/VS2019/examples/text_font_loading.vcxproj +0 -387
  115. package/vendor/raylib/projects/VS2019/examples/text_font_sdf.vcxproj +0 -387
  116. package/vendor/raylib/projects/VS2019/examples/text_font_spritefont.vcxproj +0 -387
  117. package/vendor/raylib/projects/VS2019/examples/text_format_text.vcxproj +0 -387
  118. package/vendor/raylib/projects/VS2019/examples/text_input_box.vcxproj +0 -387
  119. package/vendor/raylib/projects/VS2019/examples/text_raylib_fonts.vcxproj +0 -387
  120. package/vendor/raylib/projects/VS2019/examples/text_rectangle_bounds.vcxproj +0 -387
  121. package/vendor/raylib/projects/VS2019/examples/text_unicode.vcxproj +0 -387
  122. package/vendor/raylib/projects/VS2019/examples/text_writing_anim.vcxproj +0 -387
  123. package/vendor/raylib/projects/VS2019/examples/textures_background_scrolling.vcxproj +0 -387
  124. package/vendor/raylib/projects/VS2019/examples/textures_blend_modes.vcxproj +0 -387
  125. package/vendor/raylib/projects/VS2019/examples/textures_bunnymark.vcxproj +0 -387
  126. package/vendor/raylib/projects/VS2019/examples/textures_draw_tiled.vcxproj +0 -387
  127. package/vendor/raylib/projects/VS2019/examples/textures_image_drawing.vcxproj +0 -387
  128. package/vendor/raylib/projects/VS2019/examples/textures_image_generation.vcxproj +0 -387
  129. package/vendor/raylib/projects/VS2019/examples/textures_image_loading.vcxproj +0 -387
  130. package/vendor/raylib/projects/VS2019/examples/textures_image_processing.vcxproj +0 -387
  131. package/vendor/raylib/projects/VS2019/examples/textures_image_text.vcxproj +0 -387
  132. package/vendor/raylib/projects/VS2019/examples/textures_logo_raylib.vcxproj +0 -387
  133. package/vendor/raylib/projects/VS2019/examples/textures_mouse_painting.vcxproj +0 -387
  134. package/vendor/raylib/projects/VS2019/examples/textures_npatch_drawing.vcxproj +0 -387
  135. package/vendor/raylib/projects/VS2019/examples/textures_particles_blending.vcxproj +0 -387
  136. package/vendor/raylib/projects/VS2019/examples/textures_raw_data.vcxproj +0 -387
  137. package/vendor/raylib/projects/VS2019/examples/textures_rectangle.vcxproj +0 -387
  138. package/vendor/raylib/projects/VS2019/examples/textures_sprite_button.vcxproj +0 -387
  139. package/vendor/raylib/projects/VS2019/examples/textures_sprite_explosion.vcxproj +0 -387
  140. package/vendor/raylib/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj +0 -387
  141. package/vendor/raylib/projects/VS2019/examples/textures_to_image.vcxproj +0 -387
  142. package/vendor/raylib/projects/VS2019/raylib/raylib.vcxproj +0 -341
  143. package/vendor/raylib/projects/VS2019/raylib.sln +0 -2293
  144. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +0 -226
  145. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +0 -10
  146. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +0 -4
  147. package/vendor/raylib/projects/VS2019-Android/raylib_android.sln +0 -75
  148. package/vendor/raylib/projects/VS2022/examples/audio_module_playing.vcxproj +0 -390
  149. package/vendor/raylib/projects/VS2022/examples/audio_multichannel_sound.vcxproj +0 -390
  150. package/vendor/raylib/projects/VS2022/examples/audio_music_stream.vcxproj +0 -390
  151. package/vendor/raylib/projects/VS2022/examples/audio_raw_stream.vcxproj +0 -390
  152. package/vendor/raylib/projects/VS2022/examples/audio_sound_loading.vcxproj +0 -390
  153. package/vendor/raylib/projects/VS2022/examples/core_2d_camera.vcxproj +0 -390
  154. package/vendor/raylib/projects/VS2022/examples/core_2d_camera_platformer.vcxproj +0 -390
  155. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_first_person.vcxproj +0 -390
  156. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_free.vcxproj +0 -390
  157. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_mode.vcxproj +0 -390
  158. package/vendor/raylib/projects/VS2022/examples/core_3d_picking.vcxproj +0 -390
  159. package/vendor/raylib/projects/VS2022/examples/core_basic_window.vcxproj +0 -390
  160. package/vendor/raylib/projects/VS2022/examples/core_custom_logging.vcxproj +0 -390
  161. package/vendor/raylib/projects/VS2022/examples/core_drop_files.vcxproj +0 -390
  162. package/vendor/raylib/projects/VS2022/examples/core_input_gamepad.vcxproj +0 -387
  163. package/vendor/raylib/projects/VS2022/examples/core_input_gestures.vcxproj +0 -387
  164. package/vendor/raylib/projects/VS2022/examples/core_input_keys.vcxproj +0 -387
  165. package/vendor/raylib/projects/VS2022/examples/core_input_mouse.vcxproj +0 -387
  166. package/vendor/raylib/projects/VS2022/examples/core_input_mouse_wheel.vcxproj +0 -387
  167. package/vendor/raylib/projects/VS2022/examples/core_input_multitouch.vcxproj +0 -387
  168. package/vendor/raylib/projects/VS2022/examples/core_loading_thread.vcxproj +0 -387
  169. package/vendor/raylib/projects/VS2022/examples/core_quat_conversion.vcxproj +0 -387
  170. package/vendor/raylib/projects/VS2022/examples/core_random_values.vcxproj +0 -387
  171. package/vendor/raylib/projects/VS2022/examples/core_scissor_test.vcxproj +0 -387
  172. package/vendor/raylib/projects/VS2022/examples/core_split_screen.vcxproj +0 -387
  173. package/vendor/raylib/projects/VS2022/examples/core_storage_values.vcxproj +0 -387
  174. package/vendor/raylib/projects/VS2022/examples/core_vr_simulator.vcxproj +0 -387
  175. package/vendor/raylib/projects/VS2022/examples/core_window_flags.vcxproj +0 -387
  176. package/vendor/raylib/projects/VS2022/examples/core_window_letterbox.vcxproj +0 -387
  177. package/vendor/raylib/projects/VS2022/examples/core_world_screen.vcxproj +0 -387
  178. package/vendor/raylib/projects/VS2022/examples/easings_testbed.vcxproj +0 -387
  179. package/vendor/raylib/projects/VS2022/examples/embedded_files_loading.vcxproj +0 -387
  180. package/vendor/raylib/projects/VS2022/examples/models_animation.vcxproj +0 -387
  181. package/vendor/raylib/projects/VS2022/examples/models_billboard.vcxproj +0 -387
  182. package/vendor/raylib/projects/VS2022/examples/models_box_collisions.vcxproj +0 -387
  183. package/vendor/raylib/projects/VS2022/examples/models_cubicmap.vcxproj +0 -387
  184. package/vendor/raylib/projects/VS2022/examples/models_first_person_maze.vcxproj +0 -387
  185. package/vendor/raylib/projects/VS2022/examples/models_geometric_shapes.vcxproj +0 -387
  186. package/vendor/raylib/projects/VS2022/examples/models_heightmap.vcxproj +0 -387
  187. package/vendor/raylib/projects/VS2022/examples/models_loading.vcxproj +0 -387
  188. package/vendor/raylib/projects/VS2022/examples/models_loading_gltf.vcxproj +0 -387
  189. package/vendor/raylib/projects/VS2022/examples/models_loading_vox.vcxproj +0 -387
  190. package/vendor/raylib/projects/VS2022/examples/models_mesh_generation.vcxproj +0 -387
  191. package/vendor/raylib/projects/VS2022/examples/models_mesh_picking.vcxproj +0 -387
  192. package/vendor/raylib/projects/VS2022/examples/models_orthographic_projection.vcxproj +0 -387
  193. package/vendor/raylib/projects/VS2022/examples/models_rlgl_solar_system.vcxproj +0 -387
  194. package/vendor/raylib/projects/VS2022/examples/models_skybox.vcxproj +0 -387
  195. package/vendor/raylib/projects/VS2022/examples/models_waving_cubes.vcxproj +0 -387
  196. package/vendor/raylib/projects/VS2022/examples/models_yaw_pitch_roll.vcxproj +0 -387
  197. package/vendor/raylib/projects/VS2022/examples/physics_demo.vcxproj +0 -387
  198. package/vendor/raylib/projects/VS2022/examples/physics_friction.vcxproj +0 -387
  199. package/vendor/raylib/projects/VS2022/examples/physics_movement.vcxproj +0 -387
  200. package/vendor/raylib/projects/VS2022/examples/physics_restitution.vcxproj +0 -387
  201. package/vendor/raylib/projects/VS2022/examples/physics_shatter.vcxproj +0 -387
  202. package/vendor/raylib/projects/VS2022/examples/raudio_standalone.vcxproj +0 -387
  203. package/vendor/raylib/projects/VS2022/examples/rlgl_standalone.vcxproj +0 -391
  204. package/vendor/raylib/projects/VS2022/examples/shaders_basic_lighting.vcxproj +0 -387
  205. package/vendor/raylib/projects/VS2022/examples/shaders_custom_uniform.vcxproj +0 -387
  206. package/vendor/raylib/projects/VS2022/examples/shaders_eratosthenes.vcxproj +0 -387
  207. package/vendor/raylib/projects/VS2022/examples/shaders_fog.vcxproj +0 -387
  208. package/vendor/raylib/projects/VS2022/examples/shaders_hot_reloading.vcxproj +0 -387
  209. package/vendor/raylib/projects/VS2022/examples/shaders_julia_set.vcxproj +0 -387
  210. package/vendor/raylib/projects/VS2022/examples/shaders_mesh_instancing.vcxproj +0 -387
  211. package/vendor/raylib/projects/VS2022/examples/shaders_model_shader.vcxproj +0 -387
  212. package/vendor/raylib/projects/VS2022/examples/shaders_multi_sample2d.vcxproj +0 -387
  213. package/vendor/raylib/projects/VS2022/examples/shaders_palette_switch.vcxproj +0 -387
  214. package/vendor/raylib/projects/VS2022/examples/shaders_postprocessing.vcxproj +0 -387
  215. package/vendor/raylib/projects/VS2022/examples/shaders_raymarching.vcxproj +0 -387
  216. package/vendor/raylib/projects/VS2022/examples/shaders_shapes_textures.vcxproj +0 -387
  217. package/vendor/raylib/projects/VS2022/examples/shaders_simple_mask.vcxproj +0 -387
  218. package/vendor/raylib/projects/VS2022/examples/shaders_spotlight.vcxproj +0 -387
  219. package/vendor/raylib/projects/VS2022/examples/shaders_texture_drawing.vcxproj +0 -387
  220. package/vendor/raylib/projects/VS2022/examples/shaders_texture_waves.vcxproj +0 -387
  221. package/vendor/raylib/projects/VS2022/examples/shapes_basic_shapes.vcxproj +0 -387
  222. package/vendor/raylib/projects/VS2022/examples/shapes_bouncing_ball.vcxproj +0 -387
  223. package/vendor/raylib/projects/VS2022/examples/shapes_collision_area.vcxproj +0 -387
  224. package/vendor/raylib/projects/VS2022/examples/shapes_colors_palette.vcxproj +0 -387
  225. package/vendor/raylib/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj +0 -387
  226. package/vendor/raylib/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj +0 -387
  227. package/vendor/raylib/projects/VS2022/examples/shapes_draw_ring.vcxproj +0 -387
  228. package/vendor/raylib/projects/VS2022/examples/shapes_easings_ball_anim.vcxproj +0 -387
  229. package/vendor/raylib/projects/VS2022/examples/shapes_easings_box_anim.vcxproj +0 -387
  230. package/vendor/raylib/projects/VS2022/examples/shapes_easings_rectangle_array.vcxproj +0 -387
  231. package/vendor/raylib/projects/VS2022/examples/shapes_following_eyes.vcxproj +0 -387
  232. package/vendor/raylib/projects/VS2022/examples/shapes_lines_bezier.vcxproj +0 -387
  233. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib.vcxproj +0 -387
  234. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib_anim.vcxproj +0 -387
  235. package/vendor/raylib/projects/VS2022/examples/shapes_rectangle_scaling.vcxproj +0 -387
  236. package/vendor/raylib/projects/VS2022/examples/text_font_filters.vcxproj +0 -387
  237. package/vendor/raylib/projects/VS2022/examples/text_font_loading.vcxproj +0 -387
  238. package/vendor/raylib/projects/VS2022/examples/text_font_sdf.vcxproj +0 -387
  239. package/vendor/raylib/projects/VS2022/examples/text_font_spritefont.vcxproj +0 -387
  240. package/vendor/raylib/projects/VS2022/examples/text_format_text.vcxproj +0 -387
  241. package/vendor/raylib/projects/VS2022/examples/text_input_box.vcxproj +0 -387
  242. package/vendor/raylib/projects/VS2022/examples/text_raylib_fonts.vcxproj +0 -387
  243. package/vendor/raylib/projects/VS2022/examples/text_rectangle_bounds.vcxproj +0 -387
  244. package/vendor/raylib/projects/VS2022/examples/text_unicode.vcxproj +0 -387
  245. package/vendor/raylib/projects/VS2022/examples/text_writing_anim.vcxproj +0 -387
  246. package/vendor/raylib/projects/VS2022/examples/textures_background_scrolling.vcxproj +0 -387
  247. package/vendor/raylib/projects/VS2022/examples/textures_blend_modes.vcxproj +0 -387
  248. package/vendor/raylib/projects/VS2022/examples/textures_bunnymark.vcxproj +0 -387
  249. package/vendor/raylib/projects/VS2022/examples/textures_draw_tiled.vcxproj +0 -387
  250. package/vendor/raylib/projects/VS2022/examples/textures_image_drawing.vcxproj +0 -387
  251. package/vendor/raylib/projects/VS2022/examples/textures_image_generation.vcxproj +0 -387
  252. package/vendor/raylib/projects/VS2022/examples/textures_image_loading.vcxproj +0 -387
  253. package/vendor/raylib/projects/VS2022/examples/textures_image_processing.vcxproj +0 -387
  254. package/vendor/raylib/projects/VS2022/examples/textures_image_text.vcxproj +0 -387
  255. package/vendor/raylib/projects/VS2022/examples/textures_logo_raylib.vcxproj +0 -387
  256. package/vendor/raylib/projects/VS2022/examples/textures_mouse_painting.vcxproj +0 -387
  257. package/vendor/raylib/projects/VS2022/examples/textures_npatch_drawing.vcxproj +0 -387
  258. package/vendor/raylib/projects/VS2022/examples/textures_particles_blending.vcxproj +0 -387
  259. package/vendor/raylib/projects/VS2022/examples/textures_raw_data.vcxproj +0 -387
  260. package/vendor/raylib/projects/VS2022/examples/textures_rectangle.vcxproj +0 -387
  261. package/vendor/raylib/projects/VS2022/examples/textures_sprite_button.vcxproj +0 -387
  262. package/vendor/raylib/projects/VS2022/examples/textures_sprite_explosion.vcxproj +0 -387
  263. package/vendor/raylib/projects/VS2022/examples/textures_srcrec_dstrec.vcxproj +0 -387
  264. package/vendor/raylib/projects/VS2022/examples/textures_to_image.vcxproj +0 -387
  265. package/vendor/raylib/projects/VS2022/raylib/raylib.vcxproj +0 -340
  266. package/vendor/raylib/projects/VS2022/raylib.sln +0 -2274
@@ -237,7 +237,8 @@ static Napi::Value TranslateCall(const Napi::CallbackInfo &info)
237
237
  if (RG_LIKELY(param.gpr_count)) {
238
238
  *(gpr_ptr++) = (uint64_t)b;
239
239
  } else {
240
- *(args_ptr++) = (uint8_t)b;
240
+ *args_ptr = (uint8_t)b;
241
+ args_ptr += 8;
241
242
  }
242
243
  } break;
243
244
  case PrimitiveKind::Int8:
@@ -260,7 +261,7 @@ static Napi::Value TranslateCall(const Napi::CallbackInfo &info)
260
261
  } else {
261
262
  args_ptr = AlignUp(args_ptr, param.type->align);
262
263
  memcpy(args_ptr, &v, param.type->size); // Little Endian
263
- args_ptr += param.type->size;
264
+ args_ptr += 8;
264
265
  }
265
266
  } break;
266
267
  case PrimitiveKind::Float32: {
@@ -276,7 +277,7 @@ static Napi::Value TranslateCall(const Napi::CallbackInfo &info)
276
277
  } else {
277
278
  args_ptr = AlignUp(args_ptr, 4);
278
279
  memcpy(args_ptr, &f, 4);
279
- args_ptr += 4;
280
+ args_ptr += 8;
280
281
  }
281
282
  } break;
282
283
  case PrimitiveKind::Float64: {
@@ -387,7 +388,7 @@ static Napi::Value TranslateCall(const Napi::CallbackInfo &info)
387
388
  args_ptr = AlignUp(args_ptr, param.type->align);
388
389
  if (!call.PushObject(obj, param.type, args_ptr))
389
390
  return env.Null();
390
- args_ptr += param.type->size;
391
+ args_ptr += AlignLen(param.type->size, 8);
391
392
  }
392
393
  } break;
393
394
  }
package/src/ffi.cc CHANGED
@@ -566,6 +566,30 @@ InstanceData::InstanceData()
566
566
  heap_mem.ptr = (uint8_t *)Allocator::Allocate(&mem_alloc, heap_mem.len);
567
567
  }
568
568
 
569
+ template <typename Func>
570
+ static void SetExports(Napi::Env env, Func func)
571
+ {
572
+ func("struct", Napi::Function::New(env, CreateStructType));
573
+ func("handle", Napi::Function::New(env, CreateHandleType));
574
+ func("pointer", Napi::Function::New(env, CreatePointerType));
575
+ func("load", Napi::Function::New(env, LoadSharedLibrary));
576
+ func("in", Napi::Function::New(env, MarkIn));
577
+ func("out", Napi::Function::New(env, MarkOut));
578
+ func("inout", Napi::Function::New(env, MarkInOut));
579
+
580
+ func("internal", Napi::Boolean::New(env, true));
581
+ #if defined(_WIN32)
582
+ func("extension", Napi::String::New(env, ".dll"));
583
+ #elif defined(__APPLE__)
584
+ func("extension", Napi::String::New(env, ".dylib"));
585
+ #else
586
+ func("extension", Napi::String::New(env, ".so"));
587
+ #endif
588
+
589
+ Napi::Object types = InitBaseTypes(env);
590
+ func("types", types);
591
+ }
592
+
569
593
  }
570
594
 
571
595
  #if NODE_WANT_INTERNALS
@@ -604,25 +628,7 @@ static void InitInternal(v8::Local<v8::Object> target, v8::Local<v8::Value>,
604
628
  instance->debug = GetDebugFlag("DUMP_CALLS");
605
629
  FillRandomSafe(&instance->tag_lower, RG_SIZE(instance->tag_lower));
606
630
 
607
- SetValue(env, target, "struct", Napi::Function::New(env_napi, CreateStructType));
608
- SetValue(env, target, "handle", Napi::Function::New(env_napi, CreateHandleType));
609
- SetValue(env, target, "pointer", Napi::Function::New(env_napi, CreatePointerType));
610
- SetValue(env, target, "load", Napi::Function::New(env_napi, LoadSharedLibrary));
611
- SetValue(env, target, "in", Napi::Function::New(env_napi, MarkIn));
612
- SetValue(env, target, "out", Napi::Function::New(env_napi, MarkOut));
613
- SetValue(env, target, "inout", Napi::Function::New(env_napi, MarkInOut));
614
-
615
- SetValue(env, target, "internal", Napi::Boolean::New(env_napi, true));
616
- #if defined(_WIN32)
617
- SetValue(env, target, "extension", Napi::String::New(env_napi, ".dll"));
618
- #elif defined(__APPLE__)
619
- SetValue(env, target, "extension", Napi::String::New(env_napi, ".dylib"));
620
- #else
621
- SetValue(env, target, "extension", Napi::String::New(env_napi, ".so"));
622
- #endif
623
-
624
- Napi::Object types = InitBaseTypes(env_cxx);
625
- SetValue(env, target, "types", types);
631
+ SetExports(env_napi, [&](const char *name, Napi::Value value) { SetValue(env, target, name, value); });
626
632
  }
627
633
 
628
634
  #else
@@ -637,25 +643,7 @@ static Napi::Object InitModule(Napi::Env env, Napi::Object exports)
637
643
  instance->debug = GetDebugFlag("DUMP_CALLS");
638
644
  FillRandomSafe(&instance->tag_lower, RG_SIZE(instance->tag_lower));
639
645
 
640
- exports.Set("struct", Napi::Function::New(env, CreateStructType));
641
- exports.Set("handle", Napi::Function::New(env, CreateHandleType));
642
- exports.Set("pointer", Napi::Function::New(env, CreatePointerType));
643
- exports.Set("load", Napi::Function::New(env, LoadSharedLibrary));
644
- exports.Set("in", Napi::Function::New(env, MarkIn));
645
- exports.Set("out", Napi::Function::New(env, MarkOut));
646
- exports.Set("inout", Napi::Function::New(env, MarkInOut));
647
-
648
- exports.Set("internal", Napi::Boolean::New(env, false));
649
- #if defined(_WIN32)
650
- exports.Set("extension", Napi::String::New(env, ".dll"));
651
- #elif defined(__APPLE__)
652
- exports.Set("extension", Napi::String::New(env, ".dylib"));
653
- #else
654
- exports.Set("extension", Napi::String::New(env, ".so"));
655
- #endif
656
-
657
- Napi::Object types = InitBaseTypes(env);
658
- exports.Set("types", types);
646
+ SetExports(env, [&](const char *name, Napi::Value value) { exports.Set(name, value); });
659
647
 
660
648
  return exports;
661
649
  }
package/src/util.hh CHANGED
@@ -99,8 +99,8 @@ public:
99
99
  return MakeSpan(ptr, len);
100
100
  }
101
101
 
102
- template <typename T>
103
- bool AllocStack(Size size, Size align, T **out_ptr);
102
+ template <typename T = void>
103
+ bool AllocStack(Size size, Size align, T **out_ptr = nullptr);
104
104
  template <typename T>
105
105
  bool AllocHeap(Size size, Size align, T **out_ptr);
106
106
 
@@ -127,7 +127,9 @@ bool CallData::AllocStack(Size size, Size align, T **out_ptr)
127
127
 
128
128
  stack_mem->len -= delta;
129
129
 
130
- *out_ptr = (T *)ptr;
130
+ if (out_ptr) {
131
+ *out_ptr = (T *)ptr;
132
+ }
131
133
  return true;
132
134
  }
133
135
 
@@ -24,7 +24,11 @@
24
24
  "tests": {
25
25
  "Linux ARM32": {
26
26
  "directory": "/home/debian/luigi",
27
- "build": "npm install --production",
27
+ "build": {
28
+ "Install": "npm install --production --ignore-scripts",
29
+ "Build Koffi": "node ../cnoke/cnoke.js",
30
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
31
+ },
28
32
  "commands": {
29
33
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
30
34
  "Test Misc": "node test/tests/misc.js",
@@ -59,7 +63,11 @@
59
63
  "tests": {
60
64
  "Linux ARM64": {
61
65
  "directory": "/home/debian/luigi",
62
- "build": "npm install --production",
66
+ "build": {
67
+ "Install": "npm install --production --ignore-scripts",
68
+ "Build Koffi": "node ../cnoke/cnoke.js",
69
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
70
+ },
63
71
  "commands": {
64
72
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
65
73
  "Test Misc": "node test/tests/misc.js",
@@ -94,7 +102,11 @@
94
102
  "tests": {
95
103
  "Linux i386": {
96
104
  "directory": "/home/debian/luigi",
97
- "build": "npm install --production",
105
+ "build": {
106
+ "Install": "npm install --production --ignore-scripts",
107
+ "Build Koffi": "node ../cnoke/cnoke.js",
108
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
109
+ },
98
110
  "commands": {
99
111
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
100
112
  "Test Misc": "node test/tests/misc.js",
@@ -129,7 +141,11 @@
129
141
  "tests": {
130
142
  "Linux x64": {
131
143
  "directory": "/home/debian/luigi",
132
- "build": "npm install --production",
144
+ "build": {
145
+ "Install": "npm install --production --ignore-scripts",
146
+ "Build Koffi": "node ../cnoke/cnoke.js",
147
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
148
+ },
133
149
  "commands": {
134
150
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
135
151
  "Test Misc": "node test/tests/misc.js",
@@ -164,7 +180,11 @@
164
180
  "tests": {
165
181
  "Windows i386": {
166
182
  "directory": "C:/Users/windows/Desktop/luigi32",
167
- "build": "C:\\Node32\\node32.cmd npm install --production",
183
+ "build": {
184
+ "Install": "C:\\Node32\\node32.cmd npm install --production --ignore-scripts",
185
+ "Build Koffi": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js",
186
+ "Build dependencies": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js -C test"
187
+ },
168
188
  "commands": {
169
189
  "Test Raylib": "seatsh C:\\Node32\\node32.cmd node test/tests/raylib.js",
170
190
  "Test Misc": "C:\\Node32\\node32.cmd node test/tests/misc.js",
@@ -174,7 +194,11 @@
174
194
 
175
195
  "Windows x64": {
176
196
  "directory": "C:/Users/windows/Desktop/luigi64",
177
- "build": "C:\\Node64\\node64.cmd npm install --production",
197
+ "build": {
198
+ "Install": "C:\\Node64\\node64.cmd npm install --production --ignore-scripts",
199
+ "Build Koffi": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js",
200
+ "Build dependencies": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js -C test"
201
+ },
178
202
  "commands": {
179
203
  "Test Raylib": "seatsh C:\\Node64\\node64.cmd node test/tests/raylib.js",
180
204
  "Test Misc": "C:\\Node64\\node64.cmd node test/tests/misc.js",
@@ -209,7 +233,11 @@
209
233
  "tests": {
210
234
  "FreeBSD x64": {
211
235
  "directory": "/home/freebsd/luigi",
212
- "build": "npm install --production",
236
+ "build": {
237
+ "Install": "npm install --production --ignore-scripts",
238
+ "Build Koffi": "node ../cnoke/cnoke.js",
239
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
240
+ },
213
241
  "commands": {
214
242
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
215
243
  "Test Misc": "node test/tests/misc.js",
@@ -244,7 +272,11 @@
244
272
  "tests": {
245
273
  "FreeBSD i386": {
246
274
  "directory": "/home/freebsd/luigi",
247
- "build": "npm install --production",
275
+ "build": {
276
+ "Install": "npm install --production --ignore-scripts",
277
+ "Build Koffi": "node ../cnoke/cnoke.js",
278
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
279
+ },
248
280
  "commands": {
249
281
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
250
282
  "Test Misc": "node test/tests/misc.js",
@@ -279,7 +311,11 @@
279
311
  "tests": {
280
312
  "FreeBSD ARM64": {
281
313
  "directory": "/home/freebsd/luigi",
282
- "build": "npm install --production",
314
+ "build": {
315
+ "Install": "npm install --production --ignore-scripts",
316
+ "Build Koffi": "node ../cnoke/cnoke.js",
317
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
318
+ },
283
319
  "commands": {
284
320
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
285
321
  "Test Misc": "node test/tests/misc.js",
@@ -298,7 +334,7 @@
298
334
  },
299
335
 
300
336
  "info": {
301
- "version": 1,
337
+ "version": 2,
302
338
  "platform": "darwin",
303
339
  "arch": "x64",
304
340
 
@@ -314,7 +350,11 @@
314
350
  "tests": {
315
351
  "macOS x64": {
316
352
  "directory": "/Users/macos/luigi",
317
- "build": "PATH=/usr/local/bin:/usr/bin:/bin npm install --production && PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk ../cnoke/cnoke.js",
353
+ "build": {
354
+ "Install": "PATH=/usr/local/bin:/usr/bin:/bin npm install --production --ignore-scripts",
355
+ "Build Koffi": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js",
356
+ "Build dependencies": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js -C test"
357
+ },
318
358
  "commands": {
319
359
  "Test Misc": "PATH=/usr/local/bin:/usr/bin:/bin node test/tests/misc.js",
320
360
  "Test SQLite": "PATH=/usr/local/bin:/usr/bin:/bin node test/tests/sqlite.js"
@@ -37,9 +37,9 @@ bdeac2cca1d22d70c2d388a50709d5cba3069bbd4bd1bcb102955b0ee12ca3e9 *qemu/freebsd_i
37
37
  8191cea63d738cdca6df0b2d2d6953675e1dd33cac4d98fff88ba4367b182b64 *qemu/freebsd_i386/disk.qcow2
38
38
  10f2bc603b171368cacda43485f8f72567af0a9a490b7e0fa0c14c983ae66f16 *qemu/freebsd_i386/xvfb-run.sh
39
39
  16a4f09b3e70b97f5cfb1cf9b913d67d0ec45c4342d202cc9a2b2cfee852a8de *qemu/macos_x64/ESP.qcow2
40
- 35abfe68efe9bb81b21399a41ebdf9074c377e09079d9b55ae6f8c6da0580a06 *qemu/macos_x64/install.md
41
40
  5d2ac383371b408398accee7ec27c8c09ea5b74a0de0ceea6513388b15be5d1e *qemu/macos_x64/OVMF_VARS.fd
42
- fd0c3cbabd3f9744fc82f1b9b290c215cd8400b8501767b61ce7b7b30438db7c *qemu/macos_x64/macOS.qcow2
43
- 51d13e3b6a6c579019f45a1b500fb41f4bfebef227cd605d3e07247d37476963 *qemu/macos_x64/OVMF_VARS-1024x768.fd
44
- 4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 *qemu/macos_x64/VERSION
41
+ d79538ac489f1948b04b65f12c5618c28e4a5de0be062f5cf1d73e422a091a37 *qemu/macos_x64/install.txt
42
+ 5bb918652a31eb2059450c8b0b9b2fdf51fb600a9bd892f4e6f66b4080e3e764 *qemu/macos_x64/macOS.qcow2
43
+ 5cc2d42949c7e4e763db0abeb88299972bafef991d87dbf744a5108ef9190f6f *qemu/macos_x64/OVMF_VARS-1024x768.fd
44
+ 53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3 *qemu/macos_x64/VERSION
45
45
  2a247500e8ad9aa479994097ba5976bd881fde4de1516abd14491f3dba9fe060 *qemu/macos_x64/OVMF_CODE.fd
package/test/test.js CHANGED
@@ -23,13 +23,14 @@ const util = require('util');
23
23
  const { spawn, spawnSync } = require('child_process');
24
24
  const { NodeSSH } = require('node-ssh');
25
25
  const chalk = require('chalk');
26
+ const minimatch = require('minimatch');
26
27
 
27
28
  // Globals
28
29
 
29
30
  let script_dir = null;
30
31
  let root_dir = null;
31
32
 
32
- let machines = [];
33
+ let machines = null;
33
34
  let accelerate = true;
34
35
  let ignore = new Set;
35
36
 
@@ -47,6 +48,7 @@ async function main() {
47
48
  process.chdir(script_dir);
48
49
 
49
50
  let command = test;
51
+ let patterns = [];
50
52
 
51
53
  // Parse options
52
54
  {
@@ -54,19 +56,13 @@ async function main() {
54
56
 
55
57
  if (process.argv.length >= 3 && process.argv[2][0] != '-') {
56
58
  switch (process.argv[2]) {
57
- case 'test': { command = test; } break;
58
- case 'start': { command = start; } break;
59
- case 'stop': { command = stop; } break;
60
- case 'info': { command = info; } break;
61
- case 'ssh': { command = ssh; } break;
62
- case 'reset': { command = reset; } break;
63
-
64
- default: {
65
- throw new Error(`Unknown command '${process.argv[2]}'`);
66
- } break;
59
+ case 'test': { command = test; i++; } break;
60
+ case 'start': { command = start; i++; } break;
61
+ case 'stop': { command = stop; i++; } break;
62
+ case 'info': { command = info; i++; } break;
63
+ case 'ssh': { command = ssh; i++; } break;
64
+ case 'reset': { command = reset; i++; } break;
67
65
  }
68
-
69
- i++;
70
66
  }
71
67
 
72
68
  for (; i < process.argv.length; i++) {
@@ -102,7 +98,7 @@ async function main() {
102
98
  if (arg.startsWith('__') || arg.match(/[\\/\.]/))
103
99
  throw new Error(`Machine name '${arg} is not valid`);
104
100
 
105
- machines.push(arg);
101
+ patterns.push(arg);
106
102
  }
107
103
  }
108
104
  }
@@ -138,15 +134,34 @@ async function main() {
138
134
  }
139
135
  }
140
136
 
141
- if (!machines.length) {
142
- for (let name in machines_map)
143
- machines.push(name);
137
+ if (patterns.length) {
138
+ machines = new Set;
139
+
140
+ for (let pattern of patterns) {
141
+ let re = minimatch.makeRe(pattern);
142
+
143
+ for (let name in machines_map) {
144
+ let machine = machines_map[name];
145
+
146
+ if (name.match(re) || machine.name.match(re))
147
+ machines.add(name);
148
+ }
149
+ }
150
+
151
+ if (!machines.size) {
152
+ console.log('Could not match any machine');
153
+ process.exit(1);
154
+ }
155
+ } else {
156
+ machines = new Set(Object.keys(machines_map));
144
157
 
145
- if (!machines.length) {
158
+ if (!machines.size) {
146
159
  console.error('Could not detect any machine');
147
160
  process.exit(1);
148
161
  }
149
162
  }
163
+
164
+ machines = Array.from(machines);
150
165
  machines = machines.map(name => {
151
166
  let machine = machines_map[name];
152
167
  if (machine == null) {
@@ -157,6 +172,9 @@ async function main() {
157
172
  return machine;
158
173
  });
159
174
 
175
+ console.log('Machines:', machines.map(machine => machine.name).join(', '));
176
+ console.log();
177
+
160
178
  try {
161
179
  let success = await command();
162
180
  process.exit(!success);
@@ -301,7 +319,7 @@ async function test() {
301
319
  await Promise.all(Object.keys(machine.tests).map(async suite => {
302
320
  let test = machine.tests[suite];
303
321
  let commands = {
304
- Build: test.build,
322
+ ...test.build,
305
323
  ...test.commands
306
324
  };
307
325
 
@@ -600,7 +618,7 @@ function log(machine, action, status) {
600
618
  }
601
619
 
602
620
  let align1 = Math.max(log.align - machine.name.length, 0);
603
- let align2 = Math.max(30 - action.length, 0);
621
+ let align2 = Math.max(34 - action.length, 0);
604
622
 
605
623
  console.log(` [${machine.name}]${' '.repeat(align1)} ${action}${' '.repeat(align2)} ${status}`);
606
624
  }
package/test/tests/misc.c CHANGED
@@ -12,16 +12,21 @@
12
12
  // along with this program. If not, see https://www.gnu.org/licenses/.
13
13
 
14
14
  #include <stdio.h>
15
+ #include <stdint.h>
15
16
 
16
17
  #ifdef _WIN32
17
18
  #define EXPORT __declspec(dllexport)
18
19
  #else
19
20
  #define EXPORT __attribute__((visibility("default")))
20
21
  #endif
21
- #ifdef _MSC_VER
22
- #define FASTCALL __fastcall
22
+ #if defined(_M_IX86) || defined(__i386__)
23
+ #ifdef _MSC_VER
24
+ #define FASTCALL __fastcall
25
+ #else
26
+ #define FASTCALL __attribute__((fastcall))
27
+ #endif
23
28
  #else
24
- #define FASTCALL __attribute__((fastcall))
29
+ #define FASTCALL
25
30
  #endif
26
31
 
27
32
  typedef struct Pack3 {
@@ -43,3 +48,33 @@ EXPORT void FASTCALL AddPack3(int a, int b, int c, Pack3 *p)
43
48
  p->b += b;
44
49
  p->c += c;
45
50
  }
51
+
52
+ EXPORT int64_t ConcatenateToInt1(int8_t a, int8_t b, int8_t c, int8_t d, int8_t e, int8_t f,
53
+ int8_t g, int8_t h, int8_t i, int8_t j, int8_t k, int8_t l)
54
+ {
55
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
56
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
57
+ 100000ull * g + 10000ull * h + 1000ull * i +
58
+ 100ull * j + 10ull * k + 1ull * l;
59
+ return ret;
60
+ }
61
+
62
+ EXPORT int64_t ConcatenateToInt4(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f,
63
+ int32_t g, int32_t h, int32_t i, int32_t j, int32_t k, int32_t l)
64
+ {
65
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
66
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
67
+ 100000ull * g + 10000ull * h + 1000ull * i +
68
+ 100ull * j + 10ull * k + 1ull * l;
69
+ return ret;
70
+ }
71
+
72
+ EXPORT int64_t ConcatenateToInt8(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e, int64_t f,
73
+ int64_t g, int64_t h, int64_t i, int64_t j, int64_t k, int64_t l)
74
+ {
75
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
76
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
77
+ 100000ull * g + 10000ull * h + 1000ull * i +
78
+ 100ull * j + 10ull * k + 1ull * l;
79
+ return ret;
80
+ }
@@ -36,11 +36,14 @@ async function main() {
36
36
  }
37
37
 
38
38
  async function test() {
39
- let lib_filename = path.dirname(__filename) + '/../../build/misc' + koffi.extension;
39
+ let lib_filename = path.dirname(__filename) + '/../build/misc' + koffi.extension;
40
40
  let lib = koffi.load(lib_filename);
41
41
 
42
42
  const FillPack3 = lib.cdecl('FillPack3', 'void', ['int', 'int', 'int', koffi.out(koffi.pointer(Pack3))]);
43
43
  const AddPack3 = lib.fastcall('AddPack3', 'void', ['int', 'int', 'int', koffi.inout(koffi.pointer(Pack3))]);
44
+ const ConcatenateToInt1 = lib.cdecl('ConcatenateToInt1', 'int64_t', Array(12).fill('int8_t'));
45
+ const ConcatenateToInt4 = lib.cdecl('ConcatenateToInt4', 'int64_t', Array(12).fill('int32_t'));
46
+ const ConcatenateToInt8 = lib.cdecl('ConcatenateToInt8', 'int64_t', Array(12).fill('int64_t'));
44
47
 
45
48
  let p = {};
46
49
 
@@ -49,4 +52,8 @@ async function test() {
49
52
 
50
53
  AddPack3(6, 9, -12, p);
51
54
  assert.deepEqual(p, { a: 7, b: 11, c: -9 });
55
+
56
+ assert.equal(ConcatenateToInt1(5, 6, 1, 2, 3, 9, 4, 4, 0, 6, 8, 7), 561239440687);
57
+ assert.equal(ConcatenateToInt4(5, 6, 1, 2, 3, 9, 4, 4, 0, 6, 8, 7), 561239440687);
58
+ assert.equal(ConcatenateToInt8(5, 6, 1, 2, 3, 9, 4, 4, 0, 6, 8, 7), 561239440687);
52
59
  }
@@ -83,7 +83,7 @@ async function main() {
83
83
  }
84
84
 
85
85
  async function test() {
86
- let lib_filename = path.dirname(__filename) + '/../../build/raylib' + koffi.extension;
86
+ let lib_filename = path.dirname(__filename) + '/../build/raylib' + koffi.extension;
87
87
  let lib = koffi.load(lib_filename);
88
88
 
89
89
  const InitWindow = lib.cdecl('InitWindow', 'void', ['int', 'int', 'string']);
@@ -36,7 +36,7 @@ async function main() {
36
36
  }
37
37
 
38
38
  async function test() {
39
- let lib_filename = path.dirname(__filename) + '/../../build/sqlite3' + koffi.extension;
39
+ let lib_filename = path.dirname(__filename) + '/../build/sqlite3' + koffi.extension;
40
40
  let lib = koffi.load(lib_filename);
41
41
 
42
42
  const sqlite3_open_v2 = lib.cdecl('sqlite3_open_v2', 'int', ['string', koffi.out(koffi.pointer(sqlite3_db)), 'int', 'string']);
@@ -27,7 +27,9 @@
27
27
  // It is fine to use C99 in this file because it will not be built with VS
28
28
  //========================================================================
29
29
 
30
- #define _POSIX_C_SOURCE 199309L
30
+ #ifndef _POSIX_C_SOURCE
31
+ #define _POSIX_C_SOURCE 199309L
32
+ #endif
31
33
 
32
34
  #include "internal.h"
33
35
 
@@ -26,7 +26,9 @@
26
26
  // It is fine to use C99 in this file because it will not be built with VS
27
27
  //========================================================================
28
28
 
29
- #define _POSIX_C_SOURCE 199309L
29
+ #ifndef _POSIX_C_SOURCE
30
+ #define _POSIX_C_SOURCE 199309L
31
+ #endif
30
32
 
31
33
  #include "internal.h"
32
34