Merge pull request #26577 from mshabunin:cpp-stdint

Prepare to transition to standard fixed-size types
This commit is contained in:
Alexander Smorkalov 2024-12-06 12:59:06 +03:00 committed by GitHub
commit 444d4c8360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,9 +13,11 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <cstddef> #include <cstddef>
#include <cstdint>
#else #else
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#endif #endif
//! @name Data types //! @name Data types
@ -29,43 +31,19 @@
//! - int64 - signed 8 byte integer //! - int64 - signed 8 byte integer
//! - uint64 - unsigned 8 byte integer //! - uint64 - unsigned 8 byte integer
//! @{ //! @{
#if !defined _MSC_VER && !defined __BORLANDC__ typedef int8_t schar;
# if defined __cplusplus && __cplusplus >= 201103L && !defined __APPLE__ typedef uint8_t uchar;
# include <cstdint> typedef uint16_t ushort;
# ifdef __NEWLIB__
typedef unsigned int uint;
# else
typedef std::uint32_t uint;
# endif
# else
# include <stdint.h>
typedef uint32_t uint; typedef uint32_t uint;
# endif
#else
typedef unsigned uint;
#endif
typedef signed char schar;
#ifndef __IPL_H__
typedef unsigned char uchar;
typedef unsigned short ushort;
#endif
#if defined _MSC_VER || defined __BORLANDC__
typedef __int64 int64;
typedef unsigned __int64 uint64;
# define CV_BIG_INT(n) n##I64
# define CV_BIG_UINT(n) n##UI64
#else
typedef int64_t int64; typedef int64_t int64;
typedef uint64_t uint64; typedef uint64_t uint64;
#define CV_BIG_INT(n) n##LL #define CV_BIG_INT(n) n##LL
#define CV_BIG_UINT(n) n##ULL #define CV_BIG_UINT(n) n##ULL
#endif
typedef short cv_hal_f16; typedef int16_t cv_hal_f16;
typedef short cv_hal_bf16; typedef int16_t cv_hal_bf16;
//! @}
#define CV_USRTYPE1 (void)"CV_USRTYPE1 support has been dropped in OpenCV 4.0" #define CV_USRTYPE1 (void)"CV_USRTYPE1 support has been dropped in OpenCV 4.0"
@ -174,8 +152,6 @@ typedef short cv_hal_bf16;
#define CV_16BFC4 CV_MAKETYPE(CV_16BF,4) #define CV_16BFC4 CV_MAKETYPE(CV_16BF,4)
#define CV_16BFC(n) CV_MAKETYPE(CV_16BF,(n)) #define CV_16BFC(n) CV_MAKETYPE(CV_16BF,(n))
//! @}
//! @name Comparison operation //! @name Comparison operation
//! @sa cv::CmpTypes //! @sa cv::CmpTypes
//! @{ //! @{