lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
309 stars 82 forks source link

bad windows spec files #122

Closed vi1 closed 5 years ago

vi1 commented 5 years ago

Bad json.

diff, same for 32bit:

7811c7811 < { "tag": "const", "name": "HUGE_VALL", "ns": 0, "location": "/usr/include/math.h:63:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": INF },

{ "tag": "const", "name": "HUGE_VALL", "ns": 0, "location": "/usr/include/math.h:63:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": "INF" }, 7813c7813 < { "tag": "const", "name": "HUGE_VALF", "ns": 0, "location": "/usr/include/math.h:62:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": INF },

{ "tag": "const", "name": "HUGE_VALF", "ns": 0, "location": "/usr/include/math.h:62:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": "INF" }, 7815c7815 < { "tag": "const", "name": "HUGE_VAL", "ns": 0, "location": "/usr/include/math.h:55:10", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": INF },

{ "tag": "const", "name": "HUGE_VAL", "ns": 0, "location": "/usr/include/math.h:55:10", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": "INF" }, 7983c7983 < { "tag": "const", "name": "INFINITY", "ns": 0, "location": "/usr/include/math.h:93:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": INF },

{ "tag": "const", "name": "INFINITY", "ns": 0, "location": "/usr/include/math.h:93:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": "INF" },

nsrahmad commented 5 years ago

More details please? about platform, SDL version, Lisp implementation etc.

vi1 commented 5 years ago

Windows 10, 64bit, latest sbcl. SDL2.x86_64-pc-windows-msvc.spec, SDL2.i686-pc-windows-msvc.spec must be fixed. I'd create pull request but I don't know how you produce specs, maybe script producing specs must be fixed.

vi1 commented 5 years ago

latest SDL.

There is obvious mistake -- missing double quotes in spec files:

{ "tag": "const", "name": "HUGE_VALL", "ns": 0, "location": "/usr/include/math.h:63:11", "type": { "tag": ":double", "bit-size": 64, "bit-alignment": 64 }, "value": INF },

nsrahmad commented 5 years ago

@vi1 I don't currently have access to windows machine. could you checkout my branch from https://github.com/nsrahmad/cl-sdl2/tree/fix-spec-files to check if it works.

vi1 commented 5 years ago

Yes, it works.

nsrahmad commented 5 years ago

All right then. Thank you for reporting the issue.

theneosloth commented 5 years ago

I'm not sure if this is related to the original issue, but trying to load the fix-spec-files branch on my machine (windows 10, 64 bit SBCL 1.4.14, SDL2-2.0.10-win32-x64) gives the following error:

 in: DEFMETHOD PRINT-OBJECT (SDL2-FFI:SDL-RENDERER-INFO T)
;     (FORMAT STREAM
;             "name ~S flags ~A num-texture-formats ~A texture-formats TBD max-texture-width ~
;   ~A max-texture-height ~A"
;             (SDL2::RINFO :NAME) (SDL2::RINFO :FLAGS)
;             (SDL2::RINFO :NUM-TEXTURE-FORMATS) (SDL2::RINFO :MAX-TEXTURE-WIDTH)
;             (SDL2::RINFO :MAX-TEXTURE-HEIGHT))
;
; caught ERROR:
;   during macroexpansion of
;   (FORMATTER
;    "name ~S flags ~A num-texture-formats ~A texture-formats TBD max-texture-width ~
;   ~A max-texture-height ~A").
;   Use *BREAK-ON-SIGNALS* to intercept.
;
;    error in FORMAT: Unknown directive (character: Return)
;     name ~S flags ~A num-texture-formats ~A texture-formats TBD max-texture-width ~
;   ~A max-texture-height ~A
;
nsrahmad commented 5 years ago

@theneosloth Looks like the line break in format string is somehow messed up.

Source : https://github.com/lispgames/cl-sdl2/blob/2eaf15951cf98d3c4709350c68db1341dade55e6/src/render.lisp#L9-L19

Try deleting the ~ at the end of line 12 and remove the line break so that entire format string is on one line.

If that doesn't work then retry with the above function commented out.

theneosloth commented 5 years ago

Deleting the ~ worked, thank you!