Skip to content

Commit b7260f8

Browse files
committed
gemma3-cli.cpp: fix inttypes include
1 parent 892d6cb commit b7260f8

File tree

17 files changed

+69
-1
lines changed

17 files changed

+69
-1
lines changed

common/common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "log.h"
1010
#include "llama.h"
1111

12+
#ifndef __STDC_FORMAT_MACROS
13+
#define __STDC_FORMAT_MACROS
14+
#endif
15+
1216
#include <algorithm>
1317
#include <cinttypes>
1418
#include <climits>

common/ngram-cache.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "common.h"
33
#include "log.h"
44

5+
#ifndef __STDC_FORMAT_MACROS
6+
#define __STDC_FORMAT_MACROS
7+
#endif
8+
59
#include <cinttypes>
610
#include <cstdint>
711
#include <cstdio>

examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include "common.h"
66
#include "log.h"
77

8+
#ifndef __STDC_FORMAT_MACROS
9+
#define __STDC_FORMAT_MACROS
10+
#endif
11+
812
#include <unordered_map>
913
#include <vector>
1014
#include <cassert>

examples/llava/clip.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#define STB_IMAGE_IMPLEMENTATION
1414
#include "stb_image.h"
1515

16+
#ifndef __STDC_FORMAT_MACROS
17+
#define __STDC_FORMAT_MACROS
18+
#endif
19+
1620
#include <cassert>
1721
#include <cmath>
1822
#include <cstdlib>

examples/llava/gemma3-cli.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
#include "ggml.h"
99
#include "console.h"
1010

11+
#ifndef __STDC_FORMAT_MACROS
12+
#define __STDC_FORMAT_MACROS
13+
#endif
14+
1115
#include <vector>
1216
#include <limits.h>
13-
#include <inttypes.h>
17+
#include <cinttypes>
1418

1519
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
1620
#include <signal.h>

examples/lookup/lookup-stats.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include "llama.h"
66
#include "ggml.h"
77

8+
#ifndef __STDC_FORMAT_MACROS
9+
#define __STDC_FORMAT_MACROS
10+
#endif
11+
812
#include <cstdint>
913
#include <cstdio>
1014
#include <cinttypes>

examples/quantize-stats/quantize-stats.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "llama-model.h"
44
#include "common.h"
55

6+
#ifndef __STDC_FORMAT_MACROS
7+
#define __STDC_FORMAT_MACROS
8+
#endif
9+
610
#include <algorithm>
711
#include <cassert>
812
#include <cinttypes>

examples/server/server.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#include "index.html.gz.hpp"
1919
#include "loading.html.hpp"
2020

21+
#ifndef __STDC_FORMAT_MACROS
22+
#define __STDC_FORMAT_MACROS
23+
#endif
24+
2125
#include <atomic>
2226
#include <chrono>
2327
#include <condition_variable>

ggml/src/ggml-opt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include "ggml-backend.h"
66
#include "ggml-impl.h"
77

8+
#ifndef __STDC_FORMAT_MACROS
9+
#define __STDC_FORMAT_MACROS
10+
#endif
11+
812
#include <algorithm>
913
#include <cmath>
1014
#include <cstdint>

ggml/src/ggml.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#include <alloca.h>
2020
#endif
2121

22+
#ifndef __STDC_FORMAT_MACROS
23+
#define __STDC_FORMAT_MACROS
24+
#endif
25+
2226
#include <assert.h>
2327
#include <errno.h>
2428
#include <time.h>

ggml/src/gguf.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "ggml-impl.h"
44
#include "gguf.h"
55

6+
#ifndef __STDC_FORMAT_MACROS
7+
#define __STDC_FORMAT_MACROS
8+
#endif
9+
610
#include <cinttypes>
711
#include <cstddef>
812
#include <cstdint>

src/llama-context.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include "llama-model.h"
77
#include "llama-kv-cache.h"
88

9+
#ifndef __STDC_FORMAT_MACROS
10+
#define __STDC_FORMAT_MACROS
11+
#endif
12+
913
#include <cassert>
1014
#include <cstring>
1115
#include <stdexcept>

src/llama-impl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "gguf.h"
44
#include "llama.h"
55

6+
#ifndef __STDC_FORMAT_MACROS
7+
#define __STDC_FORMAT_MACROS
8+
#endif
9+
610
#include <cinttypes>
711
#include <climits>
812
#include <cstdarg>

src/llama-model-loader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
#include "ggml.h"
44

5+
#ifndef __STDC_FORMAT_MACROS
6+
#define __STDC_FORMAT_MACROS
7+
#endif
8+
59
#include <array>
610
#include <cinttypes>
711
#include <cstring>

src/llama-quant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include "llama-model.h"
55
#include "llama-model-loader.h"
66

7+
#ifndef __STDC_FORMAT_MACROS
8+
#define __STDC_FORMAT_MACROS
9+
#endif
10+
711
#include <algorithm>
812
#include <cmath>
913
#include <cstring>

tests/test-backend-ops.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#include <ggml-backend.h>
2121
#include <ggml-cpp.h>
2222

23+
#ifndef __STDC_FORMAT_MACROS
24+
#define __STDC_FORMAT_MACROS
25+
#endif
26+
2327
#include <algorithm>
2428
#include <array>
2529
#include <cfloat>

tests/test-opt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include "ggml-cpu.h"
55
#include "ggml-opt.h"
66

7+
#ifndef __STDC_FORMAT_MACROS
8+
#define __STDC_FORMAT_MACROS
9+
#endif
10+
711
#include <cmath>
812
#include <cinttypes>
913
#include <random>

0 commit comments

Comments
 (0)