mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
build: portable integer types
This commit is contained in:
@@ -452,6 +452,50 @@ Cv64suf;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// Integer types portatibility
|
||||
#ifdef OPENCV_STDINT_HEADER
|
||||
#include OPENCV_STDINT_HEADER
|
||||
#else
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
|
||||
namespace cv {
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
}
|
||||
#elif defined(_MSC_VER) || __cplusplus >= 201103L
|
||||
#include <cstdint>
|
||||
namespace cv {
|
||||
using std::int8_t;
|
||||
using std::uint8_t;
|
||||
using std::int16_t;
|
||||
using std::uint16_t;
|
||||
using std::int32_t;
|
||||
using std::uint32_t;
|
||||
using std::int64_t;
|
||||
using std::uint64_t;
|
||||
}
|
||||
#else
|
||||
#include <stdint.h>
|
||||
namespace cv {
|
||||
typedef ::int8_t int8_t;
|
||||
typedef ::uint8_t uint8_t;
|
||||
typedef ::int16_t int16_t;
|
||||
typedef ::uint16_t uint16_t;
|
||||
typedef ::int32_t int32_t;
|
||||
typedef ::uint32_t uint32_t;
|
||||
typedef ::int64_t int64_t;
|
||||
typedef ::uint64_t uint64_t;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // OPENCV_CORE_CVDEF_H
|
||||
|
||||
@@ -45,18 +45,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "cvdef.h"
|
||||
|
||||
// int32_t / uint32_t
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
|
||||
namespace cv {
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
}
|
||||
#elif defined(_MSC_VER) || __cplusplus >= 201103L
|
||||
#include <cstdint>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user