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 c2aca5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ update-libsass: libsass-build libsass-build/include/sass/version.h

.PHONY: test
test:
go test -tags dev -race .
go test -race .

cleanfiles:
rm -rf lib include libsass-src libsass-tmp
Expand Down
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 c2aca5a

Please sign in to comment.