Corrected scope of defconstant.

Pascal J. Bourguignon [2015-11-18 16:26]
Corrected scope of defconstant.
Filename
pgl/pgl.lisp
diff --git a/pgl/pgl.lisp b/pgl/pgl.lisp
index d5dd73e..c21222b 100644
--- a/pgl/pgl.lisp
+++ b/pgl/pgl.lisp
@@ -262,26 +262,27 @@ Licensed under the AGPL3.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (eval-when (:compile-toplevel :load-toplevel :execute)
- (defconstant +action-event+        #x010)
- (defconstant +key-event+           #x020)
- (defconstant +timer-event+         #x040)
- (defconstant +window-event+        #x080)
- (defconstant +mouse-event+         #x100)
- (defconstant +click-event+         #x200)
- (defconstant +any-event+           #x3f0)
- (defconstant +window-closed+       (+ +window-event+ 1))
- (defconstant +window-resized+      (+ +window-event+ 2))
- (defconstant +last-window-closed+  (+ +window-event+ 15))
- (defconstant +action-performed+    (+ +action-event+ 1))
- (defconstant +mouse-clicked+       (+ +mouse-event+ 1))
- (defconstant +mouse-pressed+       (+ +mouse-event+ 2))
- (defconstant +mouse-released+      (+ +mouse-event+ 3))
- (defconstant +mouse-moved+         (+ +mouse-event+ 4))
- (defconstant +mouse-dragged+       (+ +mouse-event+ 5))
- (defconstant +key-pressed+         (+ +key-event+ 1))
- (defconstant +key-released+        (+ +key-event+ 2))
- (defconstant +key-typed+           (+ +key-event+ 3))
- (defconstant +timer-ticked+        (+ +timer-event+ 1)))
+  (defconstant +action-event+        #x010)
+  (defconstant +key-event+           #x020)
+  (defconstant +timer-event+         #x040)
+  (defconstant +window-event+        #x080)
+  (defconstant +mouse-event+         #x100)
+  (defconstant +click-event+         #x200)
+  (defconstant +any-event+           #x3f0))
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (defconstant +window-closed+       (+ +window-event+ 1))
+  (defconstant +window-resized+      (+ +window-event+ 2))
+  (defconstant +last-window-closed+  (+ +window-event+ 15))
+  (defconstant +action-performed+    (+ +action-event+ 1))
+  (defconstant +mouse-clicked+       (+ +mouse-event+ 1))
+  (defconstant +mouse-pressed+       (+ +mouse-event+ 2))
+  (defconstant +mouse-released+      (+ +mouse-event+ 3))
+  (defconstant +mouse-moved+         (+ +mouse-event+ 4))
+  (defconstant +mouse-dragged+       (+ +mouse-event+ 5))
+  (defconstant +key-pressed+         (+ +key-event+ 1))
+  (defconstant +key-released+        (+ +key-event+ 2))
+  (defconstant +key-typed+           (+ +key-event+ 3))
+  (defconstant +timer-ticked+        (+ +timer-event+ 1)))

 (defclass event ()
   ((type           :initarg :type           :initform 0     :type int                 :reader event-type)
ViewGit