Skip to content

Commit b05758e

Browse files
authored
Merge pull request syslog-ng#5108 from HofiOne/inttypes-compat
Add missing inttypes.h and define __STDC_FORMAT_MACROS if undefined
2 parents d68f5a5 + 5bdc6e6 commit b05758e

File tree

7 files changed

+41
-3
lines changed

7 files changed

+41
-3
lines changed

lib/compat/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set(COMPAT_HEADERS
1818
compat/cpp-end.h
1919
compat/curl.h
2020
compat/json.h
21+
compat/inttypes.h
2122
PARENT_SCOPE)
2223

2324
set(COMPAT_SOURCES

lib/compat/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ compatinclude_HEADERS = \
2222
lib/compat/un.h \
2323
lib/compat/cpp-start.h \
2424
lib/compat/cpp-end.h \
25-
lib/compat/curl.h
25+
lib/compat/curl.h \
26+
lib/compat/inttypes.h
2627

2728
compat_sources = \
2829
lib/compat/getutent.c \

lib/compat/inttypes.h

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2002-2014 Balabit
3+
* Copyright (c) 2024 Sergey Fedorov
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation; either
8+
* version 2.1 of the License, or (at your option) any later version.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*
19+
* As an additional exemption you are allowed to compile & link against the
20+
* OpenSSL libraries as published by the OpenSSL project. See the file
21+
* COPYING for details.
22+
*
23+
*/
24+
25+
#ifndef COMPAT_INTTYPES_H_INCLUDED
26+
#define COMPAT_INTTYPES_H_INCLUDED
27+
28+
#ifndef __STDC_FORMAT_MACROS
29+
#define __STDC_FORMAT_MACROS
30+
#endif
31+
32+
#include <inttypes.h>
33+
34+
#endif

modules/geoip2/maxminddb-helper.c

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "maxminddb-helper.h"
2424
#include "scratch-buffers.h"
25+
#include "compat/inttypes.h"
2526
#include <logmsg/logmsg.h>
2627
#include <messages.h>
2728

modules/grpc/otel/otel-protobuf-formatter.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "value-pairs/value-pairs.h"
2929
#include "scanner/list-scanner/list-scanner.h"
3030
#include "compat/cpp-end.h"
31+
#include "compat/inttypes.h"
3132

3233
#include <syslog.h>
3334

modules/grpc/otel/otel-protobuf-parser.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
#include "str-repr/encode.h"
3232
#include "scratch-buffers.h"
3333
#include "compat/cpp-end.h"
34-
35-
#include <inttypes.h>
34+
#include "compat/inttypes.h"
3635

3736
using namespace syslogng::grpc::otel;
3837
using namespace google::protobuf;

packaging/debian/copyright

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Files: lib/cache.*
8484
lib/compat/socket.h
8585
lib/compat/string.h
8686
lib/compat/strtok_r.c
87+
lib/compat/inttypes.h
8788
lib/control/control-server.*
8889
lib/control/control-server-unix.c
8990
lib/hostname.h

0 commit comments

Comments
 (0)