1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
From a624e066281d23fe8d5e36768e15ddf847693179 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 21:04:56 +0330
Subject: [PATCH 04/11] snprintf!
---
Modules/FindCUDA/select_compute_arch.cmake | 2 +-
Source/cmProjectCommand.cxx | 2 +-
Source/cmStringAlgorithms.cxx | 2 +-
Tests/RunCMake/Android/android.cxx | 2 +-
Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 4 ++--
Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 9351288..6b31fc2 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -132,7 +132,7 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
" {\n"
" cudaDeviceProp prop;\n"
" if (cudaSuccess == cudaGetDeviceProperties(&prop, device))\n"
- " std::printf(\"%d.%d \", prop.major, prop.minor);\n"
+ " printf(\"%d.%d \", prop.major, prop.minor);\n"
" }\n"
" return 0;\n"
"}\n")
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index f8678b9..05a76ad 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -237,7 +237,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
&v[2], &v[3]);
for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) {
if (int(i) < vc) {
- std::sprintf(vb[i], "%u", v[i]);
+ sprintf(vb[i], "%u", v[i]);
version_string += &"."[std::size_t(i == 0)];
version_string += vb[i];
version_components[i] = vb[i];
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx
index e0af281..f0a50cc 100644
--- a/Source/cmStringAlgorithms.cxx
+++ b/Source/cmStringAlgorithms.cxx
@@ -152,7 +152,7 @@ template <std::size_t N, typename T>
inline void MakeDigits(cm::string_view& view, char (&digits)[N],
const char* pattern, T value)
{
- int res = std::snprintf(digits, N, pattern, value);
+ int res = snprintf(digits, N, pattern, value);
if (res > 0 && res < static_cast<int>(N)) {
view = cm::string_view(digits, static_cast<std::size_t>(res));
}
diff --git a/Tests/RunCMake/Android/android.cxx b/Tests/RunCMake/Android/android.cxx
index a6d8c55..f47611e 100644
--- a/Tests/RunCMake/Android/android.cxx
+++ b/Tests/RunCMake/Android/android.cxx
@@ -20,7 +20,7 @@ int main()
{
#if !defined(STL_NONE)
// Require -lm implied by linking as C++.
- std::printf("%p\n", static_cast<double (*)(double)>(&std::sin));
+ printf("%p\n", static_cast<double (*)(double)>(&std::sin));
#endif
#if defined(STL_NONE)
return 0;
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 6eeba0e..80389e5 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -24,7 +24,7 @@
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
#define snprintf sprintf_s
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
+#define snprintf snprintf
#else
#define snprintf _snprintf
#endif
@@ -32,7 +32,7 @@
#define snprintf snprintf
#elif __cplusplus >= 201103L
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
+#define snprintf snprintf
#endif
#endif
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index fc86505..abaa661 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -50,7 +50,7 @@
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
#define snprintf sprintf_s
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
+#define snprintf snprintf
#else
#define snprintf _snprintf
#endif
@@ -58,7 +58,7 @@
#define snprintf snprintf
#elif __cplusplus >= 201103L
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
+#define snprintf snprintf
#endif
#endif
--
2.30.1
|