Skip to content

Commit

Permalink
Fix context option handling to not confuse sassc
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 25, 2015
1 parent 4438ff3 commit 36741c6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ extern "C" {
#define IMPLEMENT_SASS_OPTION_ACCESSOR(type, option) \
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return options->option; } \
void ADDCALL sass_option_set_##option (struct Sass_Options* options, type option) { options->option = option; }
#define IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(type, option) \
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return safe_str(options->option); } \
#define IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(type, option, def) \
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return safe_str(options->option, def); } \
void ADDCALL sass_option_set_##option (struct Sass_Options* options, type option) \
{ free(options->option); options->option = sass_strdup(option ? option : ""); }
{ free(options->option); options->option = option || def ? sass_strdup(option ? option : def) : 0; }

#define IMPLEMENT_SASS_CONTEXT_GETTER(type, option) \
type ADDCALL sass_context_get_##option (struct Sass_Context* ctx) { return ctx->option; }
Expand Down Expand Up @@ -640,12 +640,12 @@ extern "C" {
IMPLEMENT_SASS_OPTION_ACCESSOR(Sass_Importer_List, c_headers);
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, indent);
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, linefeed);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, input_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, output_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, plugin_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, include_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_file);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_root);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, input_path, 0);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, output_path, 0);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, plugin_path, 0);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, include_path, 0);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_file, 0);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_root, 0);

// Create getter and setters for context
IMPLEMENT_SASS_CONTEXT_GETTER(int, error_status);
Expand Down

0 comments on commit 36741c6

Please sign in to comment.