Skip to content

Commit

Permalink
bring in change from sass/libsas@12deef0b3
Browse files Browse the repository at this point in the history
  • Loading branch information
drewwells committed May 9, 2018
1 parent d7faa66 commit 1ad992b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions libsass-build/sass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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;
}

Expand Down Expand Up @@ -146,4 +148,4 @@ namespace Sass {
return sass_copy_c_string(str.c_str());
}

}
}
9 changes: 5 additions & 4 deletions libsass-build/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

namespace Sass {

#define out_of_memory() do { \
std::cerr << "Out of memory.\n"; \
exit(EXIT_FAILURE); \
} while (0)
// This will throw errors if built, please keep this as is
// #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);
Expand Down

0 comments on commit 1ad992b

Please sign in to comment.