Skip to content

Commit aab9121

Browse files
committed
Use a portable isize definition.
This patch removes dependency on platform specific headers.
1 parent cd508fc commit aab9121

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

include/cxx.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
#include <type_traits>
1515
#include <utility>
1616
#include <vector>
17-
#if defined(_WIN32)
18-
#include <basetsd.h>
19-
#else
20-
#include <sys/types.h>
2117
#endif
2218

2319
#if __cplusplus >= 201703L
@@ -442,11 +438,7 @@ class Error final : public std::exception {
442438

443439
#ifndef CXXBRIDGE1_RUST_ISIZE
444440
#define CXXBRIDGE1_RUST_ISIZE
445-
#if defined(_WIN32)
446-
using isize = SSIZE_T;
447-
#else
448-
using isize = ssize_t;
449-
#endif
441+
using isize = std::make_signed<std::size_t>::type;
450442
#endif // CXXBRIDGE1_RUST_ISIZE
451443

452444
std::ostream &operator<<(std::ostream &, const String &);

0 commit comments

Comments
 (0)