Skip to content

Commit d9ac962

Browse files
Correct header for size_t (#454)
* Correct header for size_t * Be consistent with using C++ specific C compat headers * NEWS bullet --------- Co-authored-by: Davis Vaughan <davis@posit.co>
1 parent 90a50cf commit d9ac962

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# cpp11 (development version)
22

3+
* Improved hygiene around using C++ specific C compatibility headers (i.e. by using `<cstring>` rather than `<string.h>` and `<cstddef>` rather than `<stddef.h>`) (#454, @MichaelChirico).
4+
35
* Fixed an rchk issue related to `std::initializer_list<named_arg>` (#457, @pachadotdev).
46

57
# cpp11 0.5.2

inst/include/cpp11/function.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#pragma once
22

3-
#include <string.h> // for strcmp
4-
53
#include <cstdio> // for snprintf
4+
#include <cstring> // for strcmp
65
#include <string> // for string, basic_string
76
#include <utility> // for forward
87

inst/include/cpp11/named_arg.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <stddef.h> // for size_t
3+
#include <cstddef> // for size_t
44

55
#include <initializer_list> // for initializer_list
66

inst/include/cpp11/r_vector.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#pragma once
22

3-
#include <stddef.h> // for ptrdiff_t, size_t
4-
53
#include <algorithm> // for max
64
#include <array> // for array
5+
#include <cstddef> // for ptrdiff_t, size_t
76
#include <cstdio> // for snprintf
87
#include <cstring> // for memcpy
98
#include <exception> // for exception

inst/include/cpp11/sexp.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#pragma once
22

3-
#include <stddef.h> // for size_t
4-
5-
#include <string> // for string, basic_string
3+
#include <cstddef> // for size_t
4+
#include <string> // for string, basic_string
65

76
#include "cpp11/R.hpp" // for SEXP, SEXPREC, REAL_ELT, R_NilV...
87
#include "cpp11/attribute_proxy.hpp" // for attribute_proxy

0 commit comments

Comments
 (0)