Skip to content

Commit 64bf8cb

Browse files
Don't define __STDC_{FORMAT,LIMIT}_MACROS (project-chip#32542)
* Don't define __STDC_{FORMAT,LIMIT}_MACROS The need for this workaround was removed in glibc years ago. See https://sourceware.org/bugzilla/show_bug.cgi?id=15366 * restyle
1 parent aa67091 commit 64bf8cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+0
-224
lines changed

src/ble/BLEEndPoint.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
*
2626
*/
2727

28-
#ifndef __STDC_LIMIT_MACROS
29-
#define __STDC_LIMIT_MACROS
30-
#endif
3128
#include <stdint.h>
3229
#include <string.h>
3330

src/ble/BleLayer.h

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747

4848
#pragma once
4949

50-
#ifndef __STDC_LIMIT_MACROS
51-
#define __STDC_LIMIT_MACROS
52-
#endif
5350
#include <stdint.h>
5451

5552
#include <ble/BleConfig.h>

src/ble/BtpEngine.h

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727

2828
#pragma once
2929

30-
#ifndef __STDC_LIMIT_MACROS
31-
#define __STDC_LIMIT_MACROS
32-
#endif
33-
3430
#include <stdint.h>
3531
#include <string.h>
3632

src/ble/tests/TestBleErrorStr.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_FORMAT_MACROS
28-
#define __STDC_FORMAT_MACROS
29-
#endif
30-
31-
#ifndef __STDC_LIMIT_MACROS
32-
#define __STDC_LIMIT_MACROS
33-
#endif
34-
3527
#include <inttypes.h>
3628
#include <stdint.h>
3729
#include <string.h>

src/controller/CHIPDeviceController.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
*
2626
*/
2727

28-
#ifndef __STDC_LIMIT_MACROS
29-
#define __STDC_LIMIT_MACROS
30-
#endif
31-
#ifndef __STDC_FORMAT_MACROS
32-
#define __STDC_FORMAT_MACROS
33-
#endif
34-
3528
// module header, comes first
3629
#include <controller/CHIPDeviceController.h>
3730

src/credentials/CHIPCert.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
*
2626
*/
2727

28-
#ifndef __STDC_LIMIT_MACROS
29-
#define __STDC_LIMIT_MACROS
30-
#endif
31-
3228
#include <stddef.h>
3329

3430
#include <credentials/CHIPCert_Internal.h>

src/credentials/CHIPCertFromX509.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
30-
3127
#include <stddef.h>
3228

3329
#include <credentials/CHIPCert.h>

src/credentials/CHIPCertToX509.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
30-
3127
#include <inttypes.h>
3228
#include <stddef.h>
3329

src/credentials/GenerateChipX509Cert.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
*
2323
*/
2424

25-
#ifndef __STDC_LIMIT_MACROS
26-
#define __STDC_LIMIT_MACROS
27-
#endif
28-
2925
#include <algorithm>
3026
#include <initializer_list>
3127
#include <inttypes.h>

src/inet/IPAddress-StringFuncts.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_LIMIT_MACROS
27-
#define __STDC_LIMIT_MACROS
28-
#endif
2926
#include <limits>
3027
#include <stdint.h>
3128
#include <stdio.h>

src/inet/IPAddress.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
*
2828
*/
2929

30-
#ifndef __STDC_LIMIT_MACROS
31-
#define __STDC_LIMIT_MACROS
32-
#endif
33-
3430
#include <inet/IPAddress.h>
3531

3632
#include <inet/InetError.h>

src/inet/InetInterface.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_LIMIT_MACROS
27-
#define __STDC_LIMIT_MACROS
28-
#endif
29-
3026
#include <inet/InetInterface.h>
3127

3228
#include <inet/IPPrefix.h>

src/inet/tests/TestInetCommon.h

-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030

3131
#pragma once
3232

33-
#ifndef __STDC_LIMIT_MACROS
34-
#define __STDC_LIMIT_MACROS
35-
#endif
36-
3733
#include <ctype.h>
3834
#include <time.h>
3935

src/inet/tests/TestInetCommonOptions.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_LIMIT_MACROS
27-
#define __STDC_LIMIT_MACROS
28-
#endif
29-
#ifndef __STDC_FORMAT_MACROS
30-
#define __STDC_FORMAT_MACROS
31-
#endif
32-
3326
#include "TestInetCommonOptions.h"
3427

3528
#include <assert.h>

src/inet/tests/TestInetCommonPosix.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@
2727
*
2828
*/
2929

30-
#ifndef __STDC_LIMIT_MACROS
31-
#define __STDC_LIMIT_MACROS
32-
#endif
33-
#ifndef __STDC_FORMAT_MACROS
34-
#define __STDC_FORMAT_MACROS
35-
#endif
36-
3730
#include "TestInetCommon.h"
3831
#include "TestInetCommonOptions.h"
3932

src/inet/tests/TestInetEndPoint.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
30-
3127
#include <errno.h>
3228
#include <inttypes.h>
3329
#include <stdint.h>

src/inet/tests/TestInetErrorStr.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_FORMAT_MACROS
28-
#define __STDC_FORMAT_MACROS
29-
#endif
30-
31-
#ifndef __STDC_LIMIT_MACROS
32-
#define __STDC_LIMIT_MACROS
33-
#endif
34-
3527
#include <inttypes.h>
3628
#include <stdint.h>
3729
#include <string.h>

src/inet/tests/TestInetLayer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
*
2626
*/
2727

28-
#ifndef __STDC_LIMIT_MACROS
29-
#define __STDC_LIMIT_MACROS
30-
#endif
31-
3228
#include <signal.h>
3329
#include <stdint.h>
3430
#include <string.h>

src/lib/asn1/ASN1Writer.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
3027
#include <ctype.h>
3128
#include <stdint.h>
3229
#include <stdio.h>

src/lib/core/ErrorStr.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*/
1818
#include <lib/core/ErrorStr.h>
1919

20-
#ifndef __STDC_FORMAT_MACROS
21-
#define __STDC_FORMAT_MACROS
22-
#endif
23-
2420
#include <lib/core/CHIPConfig.h>
2521
#include <lib/core/CHIPError.h>
2622
#include <lib/support/DLLUtil.h>

src/lib/core/TLVCircularBuffer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
*/
2929
#include <lib/core/TLVCircularBuffer.h>
3030

31-
#ifndef __STDC_LIMIT_MACROS
32-
#define __STDC_LIMIT_MACROS
33-
#endif
34-
3531
#include <lib/core/CHIPError.h>
3632
#include <lib/core/TLVReader.h>
3733
#include <lib/core/TLVTags.h>

src/lib/core/TLVDebug.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*/
1818
#include <lib/core/TLVDebug.h>
1919

20-
#ifndef __STDC_FORMAT_MACROS
21-
#define __STDC_FORMAT_MACROS
22-
#endif
23-
2420
#include <inttypes.h>
2521

2622
#include <lib/core/CHIPError.h>

src/lib/core/TLVWriter.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*/
1818
#include <lib/core/TLVWriter.h>
1919

20-
#ifndef __STDC_LIMIT_MACROS
21-
#define __STDC_LIMIT_MACROS
22-
#endif
23-
2420
#include <stdarg.h>
2521
#include <stdint.h>
2622
#include <stdio.h>

src/lib/core/tests/TestCHIPErrorStr.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
*
2525
*/
2626

27-
#ifndef __STDC_FORMAT_MACROS
28-
#define __STDC_FORMAT_MACROS
29-
#endif
30-
31-
#ifndef __STDC_LIMIT_MACROS
32-
#define __STDC_LIMIT_MACROS
33-
#endif
34-
3527
#include <inttypes.h>
3628
#include <stdint.h>
3729
#include <string.h>

src/lib/support/Base64.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
*
2323
*/
2424

25-
#ifndef __STDC_LIMIT_MACROS
26-
#define __STDC_LIMIT_MACROS
27-
#endif
2825
#include "Base64.h"
2926

3027
#include <ctype.h>

src/lib/support/CHIPArgParser.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_LIMIT_MACROS
27-
#define __STDC_LIMIT_MACROS
28-
#endif
29-
#ifndef __STDC_FORMAT_MACROS
30-
#define __STDC_FORMAT_MACROS
31-
#endif
32-
3326
#include "CHIPArgParser.hpp"
3427

3528
#if CHIP_CONFIG_ENABLE_ARG_PARSER

src/lib/support/TimeUtils.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_LIMIT_MACROS
27-
#define __STDC_LIMIT_MACROS
28-
#endif
2926
#include <limits>
3027
#include <stdint.h>
3128
#include <type_traits>

src/lib/support/tests/TestPersistedCounter.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
*
2424
*/
2525

26-
#ifndef __STDC_FORMAT_MACROS
27-
#define __STDC_FORMAT_MACROS
28-
#endif
29-
3026
#include <map>
3127
#include <string>
3228

src/lwip/standalone/arch/cc.h

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
#ifndef __ARCH_CC_H__
5353
#define __ARCH_CC_H__
5454

55-
#ifndef __STDC_LIMIT_MACROS
56-
#define __STDC_LIMIT_MACROS
57-
#endif
58-
5955
/* Include some files for defining library routines */
6056
#include <inttypes.h>
6157
#include <limits.h>

src/messaging/ExchangeContext.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
* This file implements the ExchangeContext class.
2121
*
2222
*/
23-
#ifndef __STDC_FORMAT_MACROS
24-
#define __STDC_FORMAT_MACROS
25-
#endif
26-
27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
3023

3124
#include <inttypes.h>
3225
#include <stdint.h>

src/messaging/ExchangeMessageDispatch.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
* This file provides implementation of ExchangeMessageDispatch class.
2121
*/
2222

23-
#ifndef __STDC_FORMAT_MACROS
24-
#define __STDC_FORMAT_MACROS
25-
#endif
26-
27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
30-
3123
#include <errno.h>
3224
#include <inttypes.h>
3325
#include <memory>

src/messaging/ExchangeMgr.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
*
2222
*/
2323

24-
#ifndef __STDC_FORMAT_MACROS
25-
#define __STDC_FORMAT_MACROS
26-
#endif
27-
28-
#ifndef __STDC_LIMIT_MACROS
29-
#define __STDC_LIMIT_MACROS
30-
#endif
31-
3224
#include <cstring>
3325
#include <inttypes.h>
3426
#include <stddef.h>

src/system/SystemPacketBuffer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
* mechanisms for manipulating packets of octet-serialized
2424
* data.
2525
*/
26-
// Include standard C library limit macros
27-
#ifndef __STDC_LIMIT_MACROS
28-
#define __STDC_LIMIT_MACROS
29-
#endif
3026

3127
// Include module header
3228
#include <system/SystemPacketBuffer.h>

0 commit comments

Comments
 (0)