Browse Source

More fixing C

master
Macoy Madson 3 months ago
parent
commit
866846f125
  1. 5
      src/FileSystem.cake
  2. 10
      src/SDL.cake

5
src/FileSystem.cake

@ -1,9 +1,12 @@
;; For strdup, strerror_r
(add-build-options "-D_POSIX_C_SOURCE=200809L")
(import "DynamicArray.cake"
"FileUtilities.cake"
"CHelpers.cake" "ComptimeHelpers.cake"
&with-decls "DynamicArray.cake")
(c-import "<stdio.h>"
(c-import "<stdio.h>" "<string.h>"
&with-decls "<stddef.h>" "<stdbool.h>") ;; for size_t
(var filesystem-verbose-logging bool false)

10
src/SDL.cake

@ -247,10 +247,12 @@
(return name))
;; TODO Cakelisp CHelpers support flags
(var-global keybind-modifier-flags-none (unsigned char) 0)
(var-global keybind-modifier-flags-ctrl (unsigned char) (bit-shift-<< 1 0))
(var-global keybind-modifier-flags-shift (unsigned char) (bit-shift-<< 1 1))
(var-global keybind-modifier-flags-alt (unsigned char) (bit-shift-<< 1 2))
(export-and-evaluate
;; These are defines for C compilation support (avoids initializer not constant)
(c-preprocessor-define-constant keybind-modifier-flags-none 0)
(c-preprocessor-define-constant keybind-modifier-flags-ctrl (bit-shift-<< 1 0))
(c-preprocessor-define-constant keybind-modifier-flags-shift (bit-shift-<< 1 1))
(c-preprocessor-define-constant keybind-modifier-flags-alt (bit-shift-<< 1 2)))
(defstruct keybind-key
key (unsigned int)

Loading…
Cancel
Save