Minor changes.

This commit is contained in:
Dmitry 2019-07-28 23:21:24 +03:00 committed by jeefo
commit 54da53c5eb
5 changed files with 17 additions and 11 deletions

View file

@ -85,14 +85,14 @@ public:
template <typename ...Args> size_t puts (const char *fmt, Args ...args) {
if (!*this) {
return false;
return 0;
}
return fprintf (m_handle, fmt, cr::forward <Args> (args)...);
}
bool puts (const String &buffer) {
if (!*this) {
return false;
return 0;
}
if (fputs (buffer.chars (), m_handle) < 0) {
return false;

View file

@ -57,11 +57,9 @@ CR_NAMESPACE_END
#if defined(CR_WINDOWS)
# include <direct.h>
# define stricmp _stricmp
#else
# include <unistd.h>
# include <sys/stat.h>
# define stricmp strcasecmp
#endif
#include <assert.h>
@ -147,6 +145,14 @@ struct Platform : public Singleton <Platform> {
#endif
}
bool caseStrMatch (const char *str1, const char *str2) {
#if defined(CR_WINDOWS)
return _stricmp (str1, str2) == 0;
#else
return strcasecmp (str1, str2) == 0;
#endif
}
void abort (const char *msg = "OUT OF MEMORY!") noexcept {
fprintf (stderr, "%s\n", msg);