Skip to content

Commit

Permalink
Don't redefine toString when size_t == Uint32 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke authored and mintar committed Jun 14, 2017
1 parent ba0380c commit 8076c3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tools/toolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,14 @@ std::string toString(UINT32 value)
return (std::string(c));
}

#if INTPTR_MAX != INT32_MAX
std::string toString(size_t value)
{
char c[16];
sprintf(c, "%zu", value);
return (std::string(c));
}
#endif

/*
* Konvertiere Zahl in formatierten String.
Expand Down
2 changes: 2 additions & 0 deletions src/tools/toolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ std::string toHexStringNbble(UINT8 val);
// Konvertiere eine Integer-Zahl in einen String
std::string toString(UINT32 val);
std::string toString(INT32 val);
#if INTPTR_MAX != INT32_MAX
std::string toString(size_t val);
#endif

// Konvertiere eine Gleitkomma-Zahl in einen String
std::string toString(double val, int digits_after_decimal_point);
Expand Down

0 comments on commit 8076c3d

Please sign in to comment.