Hi Mark,
If you add some extra space around P I think it will work i.e. result.print("%" P "d,%" P "d,%" P "d:\033[37m", offs, len, cap);
The additional spaces should not change the final string concatenation result
Regards,
Freddie
I just found that P is defined as:
#define P PRINTF_SIZE_T_PREFIX
The format string was changed in this commit:
****************************
commit 73cba130c32df2031a3d862ed9daf5ba00d5173b
Author: zimoch <zimoch>
Date: Thu May 16 08:28:34 2013 +0000
use ssize_t for signed index types. Win has no ssize_t, use ptrdiff_t instead.
use P instead of S as shortcut for PRINTF_SIZE_T_PREFIX because some OK already use S.
****************************
which did this:
*********************************
-#define S PRINTF_SIZE_T_PREFIX
+#define P PRINTF_SIZE_T_PREFIX
…
- result.print("%"S"d,%"S"d,%"S"d:\033[37m", offs, len, cap);
+ result.print("%"P"d,%"P"d,%"P"d:\033[37m", offs, len, cap);
*********************************
But that does not tell me how to fix it.
Thanks,
Mark
Hi Dirk and all,
The following line compiles OK on Visual Studio 2010, but fails on Visual Studio 2015:
result.print("%"P"d,%"P"d,%"P"d:\033[37m", offs, len, cap);
This is the error:
cl -EHsc -GR -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -GL -Oy- -W3 -w44355 -w44344 -MT -TP -I. -I../O.Common -I.
-I. -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32 -I../../../include -IJ:/epics/support/asyn-4-31/include -IJ:/epics/support/calc-3-6-1/include
-IJ:/epics/support/sscan-2-10-2/include -IH:/epics/base-3.15.5/include/compiler/msvc -IH:/epics/base-3.15.5/include/os/WIN32 -IH:/epics/base-3.15.5/include -c ../StreamBuffer.cc
StreamBuffer.cc
../StreamBuffer.cc(317): error C3688: invalid literal suffix 'P'; literal operator or literal operator template 'operator ""P' not found
H:/epics/base-3.15.5/configure/RULES_BUILD:233: recipe for target 'StreamBuffer.obj' failed
make[1]: *** [StreamBuffer.obj] Error 2
make[1]: Leaving directory 'J:/epics/support/stream/StreamDevice/src/O.windows-x64-static-vs2015'
H:/epics/base-3.15.5/configure/RULES_ARCHS:58: recipe for target 'install.windows-x64-static-vs2015' failed
make: *** [install.windows-x64-static-vs2015] Error 2
Can someone explain what the P characters in that format string do, and how to get this to compile on Visual Studio 2015?
Thanks,
Mark