summaryrefslogtreecommitdiff
path: root/src/comp.h
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2019-12-20 05:22:09 +0100
committerAndrea Corallo <akrl@sdf.org>2020-01-01 11:38:13 +0100
commit4496a3f5ba899c89e45cd478a22b25ddf77869ec (patch)
treefdc43a9698554a5a218104e762e80e43428c07dc /src/comp.h
parentb3cbdfc86474932e4ef8d1237ed100a6f4f4c854 (diff)
downloademacs-4496a3f5ba899c89e45cd478a22b25ddf77869ec.tar.gz
emacs-4496a3f5ba899c89e45cd478a22b25ddf77869ec.tar.bz2
emacs-4496a3f5ba899c89e45cd478a22b25ddf77869ec.zip
initial compilation unit as object add
Diffstat (limited to 'src/comp.h')
-rw-r--r--src/comp.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/comp.h b/src/comp.h
new file mode 100644
index 00000000000..457b678699c
--- /dev/null
+++ b/src/comp.h
@@ -0,0 +1,52 @@
+/* Elisp native compiler definitions
+Copyright (C) 2012-2019 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef COMP_H
+#define COMP_H
+
+#ifdef HAVE_NATIVE_COMP
+
+#include <dynlib.h>
+
+struct Lisp_Native_Compilation_Unit
+{
+ union vectorlike_header header;
+ /* Compilation unit file descriptor and handle. */
+ int fd;
+ dynlib_handle_ptr handle;
+};
+
+INLINE bool
+COMPILATIONP_UNITP (Lisp_Object a)
+{
+ return PSEUDOVECTORP (a, PVEC_NATIVE_COMP_UNIT);
+}
+
+INLINE struct Lisp_Native_Compilation_Unit *
+XCOMPILATION_UNIT (Lisp_Object a)
+{
+ eassert (COMPILATIONP_UNITP (a));
+ return XUNTAG (a, Lisp_Vectorlike, struct Lisp_Native_Compilation_Unit);
+}
+
+/* Defined in comp.c. */
+extern void syms_of_comp (void);
+extern void fill_freloc (void);
+
+#endif
+#endif