koffi 0.9.20 → 0.9.23

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 +7 -6
  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 +16 -5
  11. package/src/call_arm64_fwd.S +18 -12
  12. package/src/call_x64_sysv.cc +5 -4
  13. package/src/ffi.cc +70 -87
  14. package/src/util.cc +0 -2
  15. package/src/util.hh +5 -3
  16. package/test/registry/machines.json +21 -11
  17. package/test/test.js +38 -20
  18. package/test/tests/misc.c +98 -3
  19. package/test/tests/misc.js +30 -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
@@ -461,7 +461,8 @@ void LibraryHolder::Unref()
461
461
  }
462
462
  }
463
463
 
464
- static void RegisterPrimitiveType(InstanceData *instance, const char *name, PrimitiveKind primitive, int16_t size)
464
+ static void RegisterPrimitiveType(InstanceData *instance, const char *name, PrimitiveKind primitive,
465
+ int16_t size, int16_t align)
465
466
  {
466
467
  TypeInfo *type = instance->types.AppendDefault();
467
468
 
@@ -469,7 +470,7 @@ static void RegisterPrimitiveType(InstanceData *instance, const char *name, Prim
469
470
 
470
471
  type->primitive = primitive;
471
472
  type->size = size;
472
- type->align = size;
473
+ type->align = align;
473
474
 
474
475
  RG_ASSERT(!instance->types_map.Find(name));
475
476
  instance->types_map.Set(type);
@@ -481,53 +482,47 @@ static Napi::Object InitBaseTypes(Napi::Env env)
481
482
 
482
483
  RG_ASSERT(!instance->types.len);
483
484
 
484
- RegisterPrimitiveType(instance, "void", PrimitiveKind::Void, 0);
485
- RegisterPrimitiveType(instance, "void *", PrimitiveKind::Pointer, RG_SIZE(void *));
486
- RegisterPrimitiveType(instance, "bool", PrimitiveKind::Bool, 1);
487
- RegisterPrimitiveType(instance, "int8", PrimitiveKind::Int8, 1);
488
- RegisterPrimitiveType(instance, "int8_t", PrimitiveKind::Int8, 1);
489
- RegisterPrimitiveType(instance, "uint8", PrimitiveKind::UInt8, 1);
490
- RegisterPrimitiveType(instance, "uint8_t", PrimitiveKind::UInt8, 1);
491
- RegisterPrimitiveType(instance, "char", PrimitiveKind::Int8, 1);
492
- RegisterPrimitiveType(instance, "uchar", PrimitiveKind::UInt8, 1);
493
- RegisterPrimitiveType(instance, "unsigned char", PrimitiveKind::UInt8, 1);
494
- RegisterPrimitiveType(instance, "int16", PrimitiveKind::Int16, 2);
495
- RegisterPrimitiveType(instance, "int16_t", PrimitiveKind::Int16, 2);
496
- RegisterPrimitiveType(instance, "uint16", PrimitiveKind::UInt16, 2);
497
- RegisterPrimitiveType(instance, "uint16_t", PrimitiveKind::UInt16, 2);
498
- RegisterPrimitiveType(instance, "short", PrimitiveKind::Int16, 2);
499
- RegisterPrimitiveType(instance, "ushort", PrimitiveKind::UInt16, 2);
500
- RegisterPrimitiveType(instance, "unsigned short", PrimitiveKind::UInt16, 2);
501
- RegisterPrimitiveType(instance, "int32", PrimitiveKind::Int32, 4);
502
- RegisterPrimitiveType(instance, "int32_t", PrimitiveKind::Int32, 4);
503
- RegisterPrimitiveType(instance, "uint32", PrimitiveKind::UInt32, 4);
504
- RegisterPrimitiveType(instance, "uint32_t", PrimitiveKind::UInt32, 4);
505
- RegisterPrimitiveType(instance, "int", PrimitiveKind::Int32, 4);
506
- RegisterPrimitiveType(instance, "uint", PrimitiveKind::UInt32, 4);
507
- RegisterPrimitiveType(instance, "unsigned int", PrimitiveKind::UInt32, 4);
508
- RegisterPrimitiveType(instance, "int64", PrimitiveKind::Int64, 8);
509
- RegisterPrimitiveType(instance, "int64_t", PrimitiveKind::Int64, 8);
510
- RegisterPrimitiveType(instance, "uint64", PrimitiveKind::UInt64, 8);
511
- RegisterPrimitiveType(instance, "uint64_t", PrimitiveKind::UInt64, 8);
512
- #if ULONG_MAX == UINT64_MAX
513
- RegisterPrimitiveType(instance, "long", PrimitiveKind::Int64, 8);
514
- RegisterPrimitiveType(instance, "ulong", PrimitiveKind::UInt64, 8);
515
- RegisterPrimitiveType(instance, "unsigned long", PrimitiveKind::UInt64, 8);
516
- #else
517
- RegisterPrimitiveType(instance, "long", PrimitiveKind::Int32, 4);
518
- RegisterPrimitiveType(instance, "ulong", PrimitiveKind::UInt32, 4);
519
- RegisterPrimitiveType(instance, "unsigned long", PrimitiveKind::UInt64, 4);
520
- #endif
521
- RegisterPrimitiveType(instance, "longlong", PrimitiveKind::Int64, 8);
522
- RegisterPrimitiveType(instance, "long long", PrimitiveKind::Int64, 8);
523
- RegisterPrimitiveType(instance, "ulonglong", PrimitiveKind::UInt64, 8);
524
- RegisterPrimitiveType(instance, "unsigned long long", PrimitiveKind::UInt64, 8);
525
- RegisterPrimitiveType(instance, "float32", PrimitiveKind::Float32, 4);
526
- RegisterPrimitiveType(instance, "float64", PrimitiveKind::Float64, 8);
527
- RegisterPrimitiveType(instance, "float", PrimitiveKind::Float32, 4);
528
- RegisterPrimitiveType(instance, "double", PrimitiveKind::Float64, 8);
529
- RegisterPrimitiveType(instance, "string", PrimitiveKind::String, RG_SIZE(void *));
530
- RegisterPrimitiveType(instance, "str", PrimitiveKind::String, RG_SIZE(void *));
485
+ RegisterPrimitiveType(instance, "void", PrimitiveKind::Void, 0, 0);
486
+ RegisterPrimitiveType(instance, "void *", PrimitiveKind::Pointer, RG_SIZE(void *), alignof(void *));
487
+ RegisterPrimitiveType(instance, "bool", PrimitiveKind::Bool, RG_SIZE(bool), alignof(bool));
488
+ RegisterPrimitiveType(instance, "int8", PrimitiveKind::Int8, 1, 1);
489
+ RegisterPrimitiveType(instance, "int8_t", PrimitiveKind::Int8, 1, 1);
490
+ RegisterPrimitiveType(instance, "uint8", PrimitiveKind::UInt8, 1, 1);
491
+ RegisterPrimitiveType(instance, "uint8_t", PrimitiveKind::UInt8, 1, 1);
492
+ RegisterPrimitiveType(instance, "char", PrimitiveKind::Int8, 1, 1);
493
+ RegisterPrimitiveType(instance, "uchar", PrimitiveKind::UInt8, 1, 1);
494
+ RegisterPrimitiveType(instance, "unsigned char", PrimitiveKind::UInt8, 1, 1);
495
+ RegisterPrimitiveType(instance, "int16", PrimitiveKind::Int16, 2, 2);
496
+ RegisterPrimitiveType(instance, "int16_t", PrimitiveKind::Int16, 2, 2);
497
+ RegisterPrimitiveType(instance, "uint16", PrimitiveKind::UInt16, 2, 2);
498
+ RegisterPrimitiveType(instance, "uint16_t", PrimitiveKind::UInt16, 2, 2);
499
+ RegisterPrimitiveType(instance, "short", PrimitiveKind::Int16, 2, 2);
500
+ RegisterPrimitiveType(instance, "ushort", PrimitiveKind::UInt16, 2, 2);
501
+ RegisterPrimitiveType(instance, "unsigned short", PrimitiveKind::UInt16, 2, 2);
502
+ RegisterPrimitiveType(instance, "int32", PrimitiveKind::Int32, 4, 4);
503
+ RegisterPrimitiveType(instance, "int32_t", PrimitiveKind::Int32, 4, 4);
504
+ RegisterPrimitiveType(instance, "uint32", PrimitiveKind::UInt32, 4, 4);
505
+ RegisterPrimitiveType(instance, "uint32_t", PrimitiveKind::UInt32, 4, 4);
506
+ RegisterPrimitiveType(instance, "int", PrimitiveKind::Int32, 4, 4);
507
+ RegisterPrimitiveType(instance, "uint", PrimitiveKind::UInt32, 4, 4);
508
+ RegisterPrimitiveType(instance, "unsigned int", PrimitiveKind::UInt32, 4, 4);
509
+ RegisterPrimitiveType(instance, "int64", PrimitiveKind::Int64, 8, alignof(int64_t));
510
+ RegisterPrimitiveType(instance, "int64_t", PrimitiveKind::Int64, 8, alignof(int64_t));
511
+ RegisterPrimitiveType(instance, "uint64", PrimitiveKind::UInt64, 8, alignof(int64_t));
512
+ RegisterPrimitiveType(instance, "uint64_t", PrimitiveKind::UInt64, 8, alignof(int64_t));
513
+ RegisterPrimitiveType(instance, "long", PrimitiveKind::Int64, RG_SIZE(long), alignof(long));
514
+ RegisterPrimitiveType(instance, "ulong", PrimitiveKind::UInt64, RG_SIZE(long), alignof(long));
515
+ RegisterPrimitiveType(instance, "unsigned long", PrimitiveKind::UInt64, RG_SIZE(long), alignof(long));
516
+ RegisterPrimitiveType(instance, "longlong", PrimitiveKind::Int64, RG_SIZE(long long), alignof(long long));
517
+ RegisterPrimitiveType(instance, "long long", PrimitiveKind::Int64, RG_SIZE(long long), alignof(long long));
518
+ RegisterPrimitiveType(instance, "ulonglong", PrimitiveKind::UInt64, RG_SIZE(long long), alignof(long long));
519
+ RegisterPrimitiveType(instance, "unsigned long long", PrimitiveKind::UInt64, RG_SIZE(long long), alignof(long long));
520
+ RegisterPrimitiveType(instance, "float32", PrimitiveKind::Float32, 4, alignof(float));
521
+ RegisterPrimitiveType(instance, "float64", PrimitiveKind::Float64, 8, alignof(double));
522
+ RegisterPrimitiveType(instance, "float", PrimitiveKind::Float32, 4, alignof(float));
523
+ RegisterPrimitiveType(instance, "double", PrimitiveKind::Float64, 8, alignof(double));
524
+ RegisterPrimitiveType(instance, "string", PrimitiveKind::String, RG_SIZE(void *), alignof(void *));
525
+ RegisterPrimitiveType(instance, "str", PrimitiveKind::String, RG_SIZE(void *), alignof(void *));
531
526
 
532
527
  Napi::Object types = Napi::Object::New(env);
533
528
  for (TypeInfo &type: instance->types) {
@@ -566,6 +561,30 @@ InstanceData::InstanceData()
566
561
  heap_mem.ptr = (uint8_t *)Allocator::Allocate(&mem_alloc, heap_mem.len);
567
562
  }
568
563
 
564
+ template <typename Func>
565
+ static void SetExports(Napi::Env env, Func func)
566
+ {
567
+ func("struct", Napi::Function::New(env, CreateStructType));
568
+ func("handle", Napi::Function::New(env, CreateHandleType));
569
+ func("pointer", Napi::Function::New(env, CreatePointerType));
570
+ func("load", Napi::Function::New(env, LoadSharedLibrary));
571
+ func("in", Napi::Function::New(env, MarkIn));
572
+ func("out", Napi::Function::New(env, MarkOut));
573
+ func("inout", Napi::Function::New(env, MarkInOut));
574
+
575
+ func("internal", Napi::Boolean::New(env, true));
576
+ #if defined(_WIN32)
577
+ func("extension", Napi::String::New(env, ".dll"));
578
+ #elif defined(__APPLE__)
579
+ func("extension", Napi::String::New(env, ".dylib"));
580
+ #else
581
+ func("extension", Napi::String::New(env, ".so"));
582
+ #endif
583
+
584
+ Napi::Object types = InitBaseTypes(env);
585
+ func("types", types);
586
+ }
587
+
569
588
  }
570
589
 
571
590
  #if NODE_WANT_INTERNALS
@@ -604,25 +623,7 @@ static void InitInternal(v8::Local<v8::Object> target, v8::Local<v8::Value>,
604
623
  instance->debug = GetDebugFlag("DUMP_CALLS");
605
624
  FillRandomSafe(&instance->tag_lower, RG_SIZE(instance->tag_lower));
606
625
 
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);
626
+ SetExports(env_napi, [&](const char *name, Napi::Value value) { SetValue(env, target, name, value); });
626
627
  }
627
628
 
628
629
  #else
@@ -637,25 +638,7 @@ static Napi::Object InitModule(Napi::Env env, Napi::Object exports)
637
638
  instance->debug = GetDebugFlag("DUMP_CALLS");
638
639
  FillRandomSafe(&instance->tag_lower, RG_SIZE(instance->tag_lower));
639
640
 
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);
641
+ SetExports(env, [&](const char *name, Napi::Value value) { exports.Set(name, value); });
659
642
 
660
643
  return exports;
661
644
  }
package/src/util.cc CHANGED
@@ -215,8 +215,6 @@ void PopObject(Napi::Object obj, const uint8_t *ptr, const TypeInfo *type)
215
215
 
216
216
  RG_ASSERT(type->primitive == PrimitiveKind::Record);
217
217
 
218
- ptr = AlignUp(ptr, type->align);
219
-
220
218
  for (const RecordMember &member: type->members) {
221
219
  ptr = AlignUp(ptr, member.type->align);
222
220
 
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
 
@@ -26,7 +26,8 @@
26
26
  "directory": "/home/debian/luigi",
27
27
  "build": {
28
28
  "Install": "npm install --production --ignore-scripts",
29
- "Build": "node ../cnoke/cnoke.js"
29
+ "Build Koffi": "node ../cnoke/cnoke.js",
30
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
30
31
  },
31
32
  "commands": {
32
33
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -64,7 +65,8 @@
64
65
  "directory": "/home/debian/luigi",
65
66
  "build": {
66
67
  "Install": "npm install --production --ignore-scripts",
67
- "Build": "node ../cnoke/cnoke.js"
68
+ "Build Koffi": "node ../cnoke/cnoke.js",
69
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
68
70
  },
69
71
  "commands": {
70
72
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -102,7 +104,8 @@
102
104
  "directory": "/home/debian/luigi",
103
105
  "build": {
104
106
  "Install": "npm install --production --ignore-scripts",
105
- "Build": "node ../cnoke/cnoke.js"
107
+ "Build Koffi": "node ../cnoke/cnoke.js",
108
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
106
109
  },
107
110
  "commands": {
108
111
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -140,7 +143,8 @@
140
143
  "directory": "/home/debian/luigi",
141
144
  "build": {
142
145
  "Install": "npm install --production --ignore-scripts",
143
- "Build": "node ../cnoke/cnoke.js"
146
+ "Build Koffi": "node ../cnoke/cnoke.js",
147
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
144
148
  },
145
149
  "commands": {
146
150
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -178,7 +182,8 @@
178
182
  "directory": "C:/Users/windows/Desktop/luigi32",
179
183
  "build": {
180
184
  "Install": "C:\\Node32\\node32.cmd npm install --production --ignore-scripts",
181
- "Build": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js"
185
+ "Build Koffi": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js",
186
+ "Build dependencies": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js -C test"
182
187
  },
183
188
  "commands": {
184
189
  "Test Raylib": "seatsh C:\\Node32\\node32.cmd node test/tests/raylib.js",
@@ -191,7 +196,8 @@
191
196
  "directory": "C:/Users/windows/Desktop/luigi64",
192
197
  "build": {
193
198
  "Install": "C:\\Node64\\node64.cmd npm install --production --ignore-scripts",
194
- "Build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js"
199
+ "Build Koffi": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js",
200
+ "Build dependencies": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js -C test"
195
201
  },
196
202
  "commands": {
197
203
  "Test Raylib": "seatsh C:\\Node64\\node64.cmd node test/tests/raylib.js",
@@ -229,7 +235,8 @@
229
235
  "directory": "/home/freebsd/luigi",
230
236
  "build": {
231
237
  "Install": "npm install --production --ignore-scripts",
232
- "Build": "node ../cnoke/cnoke.js"
238
+ "Build Koffi": "node ../cnoke/cnoke.js",
239
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
233
240
  },
234
241
  "commands": {
235
242
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -267,7 +274,8 @@
267
274
  "directory": "/home/freebsd/luigi",
268
275
  "build": {
269
276
  "Install": "npm install --production --ignore-scripts",
270
- "Build": "node ../cnoke/cnoke.js"
277
+ "Build Koffi": "node ../cnoke/cnoke.js",
278
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
271
279
  },
272
280
  "commands": {
273
281
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -304,8 +312,9 @@
304
312
  "FreeBSD ARM64": {
305
313
  "directory": "/home/freebsd/luigi",
306
314
  "build": {
307
- "Build": "npm install --production --ignore-scripts",
308
- "Install": "node ../cnoke/cnoke.js"
315
+ "Install": "npm install --production --ignore-scripts",
316
+ "Build Koffi": "node ../cnoke/cnoke.js",
317
+ "Build dependencies": "node ../cnoke/cnoke.js -C test"
309
318
  },
310
319
  "commands": {
311
320
  "Test Raylib": "xvfb-run node test/tests/raylib.js",
@@ -343,7 +352,8 @@
343
352
  "directory": "/Users/macos/luigi",
344
353
  "build": {
345
354
  "Install": "PATH=/usr/local/bin:/usr/bin:/bin npm install --production --ignore-scripts",
346
- "Build": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js"
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"
347
357
  },
348
358
  "commands": {
349
359
  "Test Misc": "PATH=/usr/local/bin:/usr/bin:/bin node test/tests/misc.js",
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);
@@ -335,7 +353,7 @@ async function test() {
335
353
 
336
354
  success = false;
337
355
 
338
- if (name == 'Build')
356
+ if (name in test.build)
339
357
  break;
340
358
  }
341
359
  }
@@ -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,24 @@
12
12
  // along with this program. If not, see https://www.gnu.org/licenses/.
13
13
 
14
14
  #include <stdio.h>
15
+ #include <inttypes.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
+ #define STDCALL __stdcall
26
+ #else
27
+ #define FASTCALL __attribute__((fastcall))
28
+ #define STDCALL __attribute__((stdcall))
29
+ #endif
23
30
  #else
24
- #define FASTCALL __attribute__((fastcall))
31
+ #define FASTCALL
32
+ #define STDCALL
25
33
  #endif
26
34
 
27
35
  typedef struct Pack3 {
@@ -30,6 +38,22 @@ typedef struct Pack3 {
30
38
  int c;
31
39
  } Pack3;
32
40
 
41
+ typedef struct IJK1 { int8_t i; int8_t j; int8_t k; } IJK1;
42
+ typedef struct IJK4 { int32_t i; int32_t j; int32_t k; } IJK4;
43
+ typedef struct IJK8 { int64_t i; int64_t j; int64_t k; } IJK8;
44
+
45
+ typedef struct BFG {
46
+ int8_t a;
47
+ int64_t b;
48
+ signed char c;
49
+ const char *d;
50
+ short e;
51
+ struct {
52
+ float f;
53
+ double g;
54
+ } inner;
55
+ } BFG;
56
+
33
57
  EXPORT void FillPack3(int a, int b, int c, Pack3 *p)
34
58
  {
35
59
  p->a = a;
@@ -43,3 +67,74 @@ EXPORT void FASTCALL AddPack3(int a, int b, int c, Pack3 *p)
43
67
  p->b += b;
44
68
  p->c += c;
45
69
  }
70
+
71
+ EXPORT int64_t ConcatenateToInt1(int8_t a, int8_t b, int8_t c, int8_t d, int8_t e, int8_t f,
72
+ int8_t g, int8_t h, int8_t i, int8_t j, int8_t k, int8_t l)
73
+ {
74
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
75
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
76
+ 100000ull * g + 10000ull * h + 1000ull * i +
77
+ 100ull * j + 10ull * k + 1ull * l;
78
+ return ret;
79
+ }
80
+
81
+ EXPORT int64_t ConcatenateToInt4(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f,
82
+ int32_t g, int32_t h, int32_t i, int32_t j, int32_t k, int32_t l)
83
+ {
84
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
85
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
86
+ 100000ull * g + 10000ull * h + 1000ull * i +
87
+ 100ull * j + 10ull * k + 1ull * l;
88
+ return ret;
89
+ }
90
+
91
+ EXPORT int64_t ConcatenateToInt8(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e, int64_t f,
92
+ int64_t g, int64_t h, int64_t i, int64_t j, int64_t k, int64_t l)
93
+ {
94
+ int64_t ret = 100000000000ull * a + 10000000000ull * b + 1000000000ull * c +
95
+ 100000000ull * d + 10000000ull * e + 1000000ull * f +
96
+ 100000ull * g + 10000ull * h + 1000ull * i +
97
+ 100ull * j + 10ull * k + 1ull * l;
98
+ return ret;
99
+ }
100
+
101
+ EXPORT const char *ConcatenateToStr1(int8_t a, int8_t b, int8_t c, int8_t d, int8_t e, int8_t f,
102
+ int8_t g, int8_t h, IJK1 ijk, int8_t l)
103
+ {
104
+ static char buf[128];
105
+ snprintf(buf, sizeof(buf), "%d%d%d%d%d%d%d%d%d%d%d%d", a, b, c, d, e, f, g, h, ijk.i, ijk.j, ijk.k, l);
106
+ return buf;
107
+ }
108
+
109
+ EXPORT const char *ConcatenateToStr4(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f,
110
+ int32_t g, int32_t h, IJK4 *ijk, int32_t l)
111
+ {
112
+ static char buf[128];
113
+ snprintf(buf, sizeof(buf), "%d%d%d%d%d%d%d%d%d%d%d%d", a, b, c, d, e, f, g, h, ijk->i, ijk->j, ijk->k, l);
114
+ return buf;
115
+ }
116
+
117
+ EXPORT const char *ConcatenateToStr8(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e, int64_t f,
118
+ int64_t g, int64_t h, IJK8 ijk, int64_t l)
119
+ {
120
+ static char buf[128];
121
+ snprintf(buf, sizeof(buf), "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64
122
+ "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64 "%" PRIi64,
123
+ a, b, c, d, e, f, g, h, ijk.i, ijk.j, ijk.k, l);
124
+ return buf;
125
+ }
126
+
127
+ EXPORT BFG STDCALL MakeBFG(int x, double y)
128
+ {
129
+ BFG bfg;
130
+
131
+ bfg.a = x;
132
+ bfg.b = x * 2;
133
+ bfg.c = x - 27;
134
+ bfg.d = "Hello";
135
+ bfg.e = x * 27;
136
+ bfg.inner.f = (float)y * x;
137
+ bfg.inner.g = (double)y - x;
138
+
139
+ return bfg;
140
+ }