Skip to content

Commit 3c777a7

Browse files
committed
Re-add wrongly remove C-API option setters
Intention was to only remove getters, as they would not return all paths (we also have the push option).
1 parent 1fc743c commit 3c777a7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/sass_context.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,14 @@ extern "C" {
272272
#define IMPLEMENT_SASS_OPTION_ACCESSOR(type, option) \
273273
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return options->option; } \
274274
void ADDCALL sass_option_set_##option (struct Sass_Options* options, type option) { options->option = option; }
275-
#define IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(type, option, def) \
276-
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return safe_str(options->option, def); } \
275+
#define IMPLEMENT_SASS_OPTION_STRING_GETTER(type, option, def) \
276+
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return safe_str(options->option, def); }
277+
#define IMPLEMENT_SASS_OPTION_STRING_SETTER(type, option, def) \
277278
void ADDCALL sass_option_set_##option (struct Sass_Options* options, type option) \
278279
{ free(options->option); options->option = option || def ? sass_copy_c_string(option ? option : def) : 0; }
280+
#define IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(type, option, def) \
281+
IMPLEMENT_SASS_OPTION_STRING_GETTER(type, option, def) \
282+
IMPLEMENT_SASS_OPTION_STRING_SETTER(type, option, def)
279283

280284
#define IMPLEMENT_SASS_CONTEXT_GETTER(type, option) \
281285
type ADDCALL sass_context_get_##option (struct Sass_Context* ctx) { return ctx->option; }
@@ -697,6 +701,8 @@ extern "C" {
697701
IMPLEMENT_SASS_OPTION_ACCESSOR(Sass_Importer_List, c_headers);
698702
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, indent);
699703
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, linefeed);
704+
IMPLEMENT_SASS_OPTION_STRING_SETTER(const char*, plugin_path, 0);
705+
IMPLEMENT_SASS_OPTION_STRING_SETTER(const char*, include_path, 0);
700706
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, input_path, 0);
701707
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, output_path, 0);
702708
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_file, 0);

0 commit comments

Comments
 (0)