Skip to content

Commit

Permalink
use cinttypes instead of inttypes.h header for C++ tests (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbaug authored Oct 1, 2022
1 parent 5e2f8c6 commit a51354a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_headers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2020 The Khronos Group Inc.
// Copyright (c) 2020-2022 The Khronos Group Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,17 @@
// limitations under the License.
//

/*
Some versions of inttypes.h required defining the macro __STDC_FORMAT_MACROS to
use the format macros for C++ compiles, but not all. To improve robustness we
will use inttypes.h for C compiles and cinttypes for C++ compiles.
*/
#if defined(__cplusplus)
#include <cinttypes>
#else
#include <inttypes.h>
#endif

#include <stdio.h>

#include "CL/cl.h"
Expand Down

0 comments on commit a51354a

Please sign in to comment.