ref: 1eb688264b7221ab4fcdb596d239eed795af1e7d
parent: e9593682eb769a27c1e178ff734b459b3c07452d
parent: 3c7dde97eeb24505cc8f418227403f3493db0205
author: Ethan Hugg <[email protected]>
date: Mon Mar 3 04:11:51 EST 2014
Merge pull request #395 from mstorsjo/printf-64bit-macro Use a standard macro for 64 bit printf conversion specifiers
--- a/codec/common/typedefs.h
+++ b/codec/common/typedefs.h
@@ -44,7 +44,9 @@
#ifndef _MSC_VER
+#define __STDC_FORMAT_MACROS
#include <stdint.h>
+#include <inttypes.h>
#else
@@ -57,6 +59,7 @@
typedef unsigned int uint32_t;
typedef __int64 int64_t ;
typedef unsigned __int64 uint64_t;
+#define PRId64 "I64d"
#endif // _MSC_VER defined
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3248,11 +3248,7 @@
t_bs_append = WelsTime() - t_bs_append;
if (pCtx->pSliceThreading->pFSliceDiff) {
fprintf (pCtx->pSliceThreading->pFSliceDiff,
-#if defined(_WIN32)
- "%6I64d us consumed at AppendSliceToFrameBs() for coding_idx: %d iDid: %d qid: %d\n",
-#else
- "%6lld us consumed at AppendSliceToFrameBs() for coding_idx: %d iDid: %d qid: %d\n",
-#endif//WIN32
+ "%6"PRId64" us consumed at AppendSliceToFrameBs() for coding_idx: %d iDid: %d qid: %d\n",
t_bs_append, pCtx->iCodingIndex, iCurDid, 0);
}
#endif//MT_DEBUG
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -1232,11 +1232,7 @@
iT0 = WelsTime() - iT0;
if (pCtx->pSliceThreading->pFSliceDiff) {
fprintf (pCtx->pSliceThreading->pFSliceDiff,
-#ifdef _WIN32
- "%6I64d us adjust time at base spatial layer, iNeedAdj %d, DynamicAdjustSlicing()\n",
-#else
- "%6lld us adjust time at base spatial layer, iNeedAdj %d, DynamicAdjustSlicing()\n",
-#endif//WIN32
+ "%6"PRId64" us adjust time at base spatial layer, iNeedAdj %d, DynamicAdjustSlicing()\n",
iT0, iNeedAdj);
}
#endif//MT_DEBUG
@@ -1283,11 +1279,7 @@
iT1 = WelsTime() - iT1;
if (pCtx->pSliceThreading->pFSliceDiff) {
fprintf (pCtx->pSliceThreading->pFSliceDiff,
-#ifdef _WIN32
- "%6I64d us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",
-#else
- "%6lld us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",
-#endif//WIN32
+ "%6"PRId64" us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",
iT1, iCurDid, iNeedAdj);
}
#endif//MT_DEBUG