Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring in change from sass/libsas@12deef0b3 #59

Merged
merged 1 commit into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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