aboutsummaryrefslogtreecommitdiff
path: root/llama.h
diff options
context:
space:
mode:
authorJuuso Alasuutari <juuso.alasuutari@gmail.com>2023-05-20 15:58:15 +0300
committerGitHub <noreply@github.com>2023-05-20 15:58:15 +0300
commit29cf5596fe0c37213f9b74e80d8f631193a93f0f (patch)
tree453cbd193794ef983faca0e396853541e98f576f /llama.h
parent3de84b26066d95068409c1dc79bcc41c1eea2a03 (diff)
llama : define magic numbers as integer constants (#1518) (#1520)
The underlying representation of multibyte character literals is implementation-defined. This could, at least in principle, cause cross-build data export/import issues independent of endianness. Define magic numbers as integer literals to be on the safe side. Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
Diffstat (limited to 'llama.h')
-rw-r--r--llama.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/llama.h b/llama.h
index 0a63d03..37bae53 100644
--- a/llama.h
+++ b/llama.h
@@ -19,10 +19,16 @@
# define LLAMA_API
#endif
+#define LLAMA_FILE_MAGIC_GGJT 0x67676a74u // 'ggjt'
+#define LLAMA_FILE_MAGIC_GGLA 0x67676c61u // 'ggla'
+#define LLAMA_FILE_MAGIC_GGMF 0x67676d66u // 'ggmf'
+#define LLAMA_FILE_MAGIC_GGML 0x67676d6cu // 'ggml'
+#define LLAMA_FILE_MAGIC_GGSN 0x6767736eu // 'ggsn'
+
#define LLAMA_FILE_VERSION 3
-#define LLAMA_FILE_MAGIC 'ggjt'
-#define LLAMA_FILE_MAGIC_UNVERSIONED 'ggml'
-#define LLAMA_SESSION_MAGIC 'ggsn'
+#define LLAMA_FILE_MAGIC LLAMA_FILE_MAGIC_GGJT
+#define LLAMA_FILE_MAGIC_UNVERSIONED LLAMA_FILE_MAGIC_GGML
+#define LLAMA_SESSION_MAGIC LLAMA_FILE_MAGIC_GGSN
#define LLAMA_SESSION_VERSION 1
#ifdef __cplusplus