diff --git a/hipamd/include/hip/amd_detail/amd_hip_runtime.h b/hipamd/include/hip/amd_detail/amd_hip_runtime.h index fd9dfddd4..f4a143798 100644 --- a/hipamd/include/hip/amd_detail/amd_hip_runtime.h +++ b/hipamd/include/hip/amd_detail/amd_hip_runtime.h @@ -93,19 +93,11 @@ typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef signed int int32_t; typedef signed long long int64_t; -#if defined(__GLIBCXX__) -typedef long int ptrdiff_t; -#else -typedef long long ptrdiff_t; -#endif -typedef long clock_t; namespace std { using ::uint32_t; using ::uint64_t; using ::int32_t; using ::int64_t; -using ::ptrdiff_t; -using ::clock_t; } #endif // __HIP_NO_STD_DEFS__ #endif // !defined(__HIPCC_RTC__) diff --git a/hipamd/src/hiprtc/cmake/HIPRTC.cmake b/hipamd/src/hiprtc/cmake/HIPRTC.cmake index 53ba93073..ef9e559d1 100644 --- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake +++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake @@ -59,6 +59,18 @@ function(get_hiprtc_macros HIPRTC_DEFINES) #define _HIP_BFLOAT16_H_\n\ #define HIP_INCLUDE_HIP_MATH_FUNCTIONS_H\n\ #define HIP_INCLUDE_HIP_HIP_VECTOR_TYPES_H\n\ +#if !__HIP_NO_STD_DEFS__\n\ +#if defined(__HIPRTC_PTRDIFF_T_IS_LONG_LONG__) && __HIPRTC_PTRDIFF_T_IS_LONG_LONG__==1\n\ +typedef long long ptrdiff_t;\n\ +#else\n\ +typedef __PTRDIFF_TYPE__ ptrdiff_t;\n\ +#endif\n\ +typedef long clock_t;\n\ +namespace std {\n\ +using ::ptrdiff_t;\n\ +using ::clock_t;\n\ +}\n\ +#endif // __HIP_NO_STD_DEFS__\n\ #pragma clang diagnostic pop" PARENT_SCOPE) endfunction(get_hiprtc_macros)