Skip to content
Permalink
Browse files

Inline out_of_memory macro

  • Loading branch information...
thatguystone authored and xzyfer committed Mar 27, 2018
1 parent 1da6264 commit f315c93dc4b7f0b3d8cbfd62140594103edbebe0
Showing with 4 additions and 7 deletions.
  1. +4 −2 src/sass.cpp
  2. +0 −5 src/util.hpp
@@ -34,8 +34,10 @@ extern "C" {
void* ADDCALL sass_alloc_memory(size_t size)
{
void* ptr = malloc(size);
if (ptr == NULL)
out_of_memory();
if (ptr == NULL) {
std::cerr << "Out of memory.\n";
exit(EXIT_FAILURE);
}
return ptr;
}

@@ -12,11 +12,6 @@

namespace Sass {

#define out_of_memory() do { \
std::cerr << "Out of memory.\n"; \
exit(EXIT_FAILURE); \
} while (0)

double round(double val, size_t precision = 0);
double sass_strtod(const char* str);
const char* safe_str(const char *, const char* = "");

0 comments on commit f315c93

Please sign in to comment.
You can’t perform that action at this time.