File tree 2 files changed +11
-10
lines changed
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ __get_cxx_version ()
149
149
}
150
150
151
151
// Split code from includes
152
- auto blocks = split_from_includes (code. c_str () );
152
+ auto blocks = split_from_includes (code);
153
153
154
154
auto errorlevel = 0 ;
155
155
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ namespace xcpp
25
25
inline nl::json mime_repr (intptr_t V)
26
26
{
27
27
// Return a JSON mime bundle representing the specified value.
28
+ void * value = (void *)V;
29
+
28
30
// Include "xcpp/xmime.hpp" only on the first time a variable is displayed.
29
31
static bool xmime_included = false ;
30
32
@@ -37,17 +39,16 @@ namespace xcpp
37
39
intptr_t mimeReprV;
38
40
bool hadError = false ;
39
41
{
40
- std::ostringstream oss;
41
- oss << reinterpret_cast <void *>(V);
42
- std::string pointerStr = oss.str ();
42
+ std::ostringstream code;
43
+ code << " using xcpp::mime_bundle_repr;" ;
44
+ code << " mime_bundle_repr(" ;
45
+ // code << "*(" << getTypeAsString(V);
46
+ code << &value;
47
+ code << " ));" ;
43
48
44
- std::string code;
45
- code = " using xcpp::mime_bundle_repr; " ;
46
- code += " mime_bundle_repr(*((const void**)" ;
47
- code += pointerStr;
48
- code += " ));" ;
49
+ std::string codeString = code.str ();
49
50
50
- mimeReprV = Cpp::Evaluate (code .c_str (), &hadError);
51
+ mimeReprV = Cpp::Evaluate (codeString .c_str (), &hadError);
51
52
}
52
53
53
54
if (!hadError && mimeReprV != 0 ) {
You can’t perform that action at this time.
0 commit comments