Skip to content

Commit 8ffcc76

Browse files
committed
Merge pull request opencv#10883 from alalek:portable_stdint
2 parents e268fdc + c020a7b commit 8ffcc76

File tree

9 files changed

+45
-24
lines changed

9 files changed

+45
-24
lines changed

modules/calib3d/src/rho.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <opencv2/core.hpp>
4949
#include <stdlib.h>
5050
#include <stdio.h>
51-
#include <stdint.h>
5251
#include <string.h>
5352
#include <stddef.h>
5453
#include <limits.h>

modules/calib3d/src/rho.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

5252
/* Includes */
5353
#include <opencv2/core.hpp>
54-
#include <stdint.h>
5554

5655

5756

modules/core/include/opencv2/core/cvdef.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,50 @@ Cv64suf;
452452
# endif
453453
#endif
454454

455+
456+
// Integer types portatibility
457+
#ifdef OPENCV_STDINT_HEADER
458+
#include OPENCV_STDINT_HEADER
459+
#else
460+
#if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
461+
namespace cv {
462+
typedef signed char int8_t;
463+
typedef unsigned char uint8_t;
464+
typedef signed short int16_t;
465+
typedef unsigned short uint16_t;
466+
typedef signed int int32_t;
467+
typedef unsigned int uint32_t;
468+
typedef signed __int64 int64_t;
469+
typedef unsigned __int64 uint64_t;
470+
}
471+
#elif defined(_MSC_VER) || __cplusplus >= 201103L
472+
#include <cstdint>
473+
namespace cv {
474+
using std::int8_t;
475+
using std::uint8_t;
476+
using std::int16_t;
477+
using std::uint16_t;
478+
using std::int32_t;
479+
using std::uint32_t;
480+
using std::int64_t;
481+
using std::uint64_t;
482+
}
483+
#else
484+
#include <stdint.h>
485+
namespace cv {
486+
typedef ::int8_t int8_t;
487+
typedef ::uint8_t uint8_t;
488+
typedef ::int16_t int16_t;
489+
typedef ::uint16_t uint16_t;
490+
typedef ::int32_t int32_t;
491+
typedef ::uint32_t uint32_t;
492+
typedef ::int64_t int64_t;
493+
typedef ::uint64_t uint64_t;
494+
}
495+
#endif
496+
#endif
497+
498+
455499
//! @}
456500

457501
#endif // OPENCV_CORE_CVDEF_H

modules/core/include/opencv2/core/softfloat.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545

4646
#include "cvdef.h"
4747

48-
// int32_t / uint32_t
49-
#if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
50-
namespace cv {
51-
typedef signed int int32_t;
52-
typedef unsigned int uint32_t;
53-
}
54-
#elif defined(_MSC_VER) || __cplusplus >= 201103L
55-
#include <cstdint>
56-
#else
57-
#include <stdint.h>
58-
#endif
59-
6048
namespace cv
6149
{
6250

modules/core/src/persistence.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88

99
#include "opencv2/core/types_c.h"
1010
#include <deque>
11-
#include <deque>
1211
#include <sstream>
1312
#include <string>
1413
#include <iterator>
15-
#ifdef _MSC_VER
16-
#include <cstdint>
17-
#endif // _MSC_VER
1814

1915
#define USE_ZLIB 1
2016
#if USE_ZLIB

modules/dnn/src/precomp.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include <opencv2/core/ocl.hpp>
4444
#include <opencv2/core/opencl/ocl_defs.hpp>
4545
#include <opencv2/core/utils/trace.hpp>
46-
#include <opencv2/core/softfloat.hpp> // int32_t (MSVS 2010-2013)
4746
#include "cvconfig.h"
4847
#include <opencv2/dnn.hpp>
4948
#include <opencv2/dnn/all_layers.hpp>

modules/imgcodecs/src/exif.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040
//
4141
//M*/
4242

43+
#include "precomp.hpp"
4344
#include "exif.hpp"
44-
#include "opencv2/core/cvdef.h"
45-
#include "opencv2/core/base.hpp"
4645

4746
namespace {
4847

modules/imgcodecs/src/exif.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <map>
4949
#include <utility>
5050
#include <algorithm>
51-
#include <stdint.h>
5251
#include <string>
5352
#include <vector>
5453
#include <iostream>

modules/imgproc/src/drawing.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
//M*/
4141
#include "precomp.hpp"
4242

43-
#include <stdint.h>
44-
4543
namespace cv
4644
{
4745

0 commit comments

Comments
 (0)