Commit da89bb3cc for llama.cpp
commit da89bb3ccc61edc4fc0d18671c927648e42af99c
Author: XZiar <15145384+XZiar@users.noreply.github.com>
Date: Tue Sep 29 10:31:31 2026 -0700
ggml : fix c++ odr by properly using GGML_COMMON_DECL_CPP (#29504)
* fix c++ odr by properly using GGML_COMMON_DECL_CPP
* using actual field rather than macro
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
---------
Co-authored-by: XZiar <xziar@xziar.xziar>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
diff --git a/ggml/src/ggml-cpu/tiled/tiled-kernel.h b/ggml/src/ggml-cpu/tiled/tiled-kernel.h
index b9df2c93c..1a97f406a 100644
--- a/ggml/src/ggml-cpu/tiled/tiled-kernel.h
+++ b/ggml/src/ggml-cpu/tiled/tiled-kernel.h
@@ -9,7 +9,7 @@
// bit unpacking routines: tiled_unpk_nib4, tiled_unpk_2bit, tiled_unpk_or
// LUT value expansion routines: tiled_lut8, tiled_unpk_sign32, tiled_unpk_tern8
-#define GGML_COMMON_DECL_C
+#define GGML_COMMON_DECL_CPP
#include "ggml-common.h"
#include <stddef.h>
diff --git a/ggml/src/ggml-cpu/tiled/tiled.cpp b/ggml/src/ggml-cpu/tiled/tiled.cpp
index 15a1d0c01..77e1a9945 100644
--- a/ggml/src/ggml-cpu/tiled/tiled.cpp
+++ b/ggml/src/ggml-cpu/tiled/tiled.cpp
@@ -35,8 +35,8 @@ static void tiled_unpack_src0(const block_q4_K * rows, int64_t row_stride, int n
const int s_off = r * nb_stride + slab * NB;
const block_q4_K & x = rows[r * row_stride + slab];
- tile->d[d_off] = ggml_fp16_to_fp32(x.d);
- tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
+ tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
+ tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
uint32_t utmp[4];
memcpy(utmp, x.scales, 12);
@@ -80,8 +80,8 @@ static void tiled_unpack_src0(const block_q5_K * rows, int64_t row_stride, int n
const int s_off = r * nb_stride + slab * NB;
const block_q5_K & x = rows[r * row_stride + slab];
- tile->d[d_off] = ggml_fp16_to_fp32(x.d);
- tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
+ tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
+ tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
uint32_t utmp[4];
memcpy(utmp, x.scales, 12);
@@ -207,8 +207,8 @@ static void tiled_unpack_src0(const block_q2_K * rows, int64_t row_stride, int n
const int q_off = r * qk_stride + slab * TILED_TILE_K;
const int s_off = r * nb_stride + slab * NB;
const block_q2_K & x = rows[r * row_stride + slab];
- tile->d[d_off] = ggml_fp16_to_fp32(x.d);
- tile->dmin[d_off] = ggml_fp16_to_fp32(x.dmin);
+ tile->d[d_off] = ggml_fp16_to_fp32(x.data.data.d);
+ tile->dmin[d_off] = ggml_fp16_to_fp32(x.data.data.dmin);
// 2-bit code: element e -> half=e>>7, el=e&127
// byte = half*32 + (el & 31), shift = 2*(el >> 5)