@@ -45,6 +45,7 @@ namespace Sass {
4545 : mem(Memory_Manager<AST_Node>()),
4646 source_c_str (initializers.source_c_str()),
4747 sources (vector<const char *>()),
48+ c_functions (vector<Sass_C_Function_Descriptor>()),
4849 include_paths (initializers.include_paths()),
4950 queue (vector<pair<string, const char *> >()),
5051 style_sheets (map<string, Block*>()),
@@ -212,6 +213,9 @@ namespace Sass {
212213 Env tge;
213214 Backtrace backtrace (0 , " " , Position (), " " );
214215 register_built_in_functions (*this , &tge);
216+ for (size_t i = 0 , S = c_functions.size (); i < S; ++i) {
217+ register_c_function (*this , &tge, c_functions[i]);
218+ }
215219 Eval eval (*this , &tge, &backtrace);
216220 Contextualize contextualize (*this , &eval, &tge, &backtrace);
217221 Expand expand (*this , &eval, &contextualize, &tge, &backtrace);
@@ -281,6 +285,9 @@ namespace Sass {
281285 char wd[wd_len];
282286 string cwd = getcwd (wd, wd_len);
283287 if (cwd[cwd.length () - 1 ] != ' /' ) cwd += ' /' ;
288+ #ifdef _WIN32
289+ replace (cwd.begin (), cwd.end (), ' \\ ' , ' /' ); // convert Windows backslashes to URL forward slashes
290+ #endif
284291 return cwd;
285292 }
286293
@@ -317,7 +324,7 @@ namespace Sass {
317324 {
318325 using namespace Functions ;
319326 // RGB Functions
320- register_function (ctx, rgb_sig, rgb, env);
327+ register_function (ctx, rgb_sig, rgb, env);
321328 register_overload_stub (ctx, " rgba" , env);
322329 register_function (ctx, rgba_4_sig, rgba_4, 4 , env);
323330 register_function (ctx, rgba_2_sig, rgba_2, 2 , env);
@@ -391,7 +398,7 @@ namespace Sass {
391398 }
392399 void register_c_function (Context& ctx, Env* env, Sass_C_Function_Descriptor descr)
393400 {
394- Definition* def = make_c_function (descr.signature , descr.function , ctx);
401+ Definition* def = make_c_function (descr.signature , descr.function , descr. cookie , ctx);
395402 def->environment (env);
396403 (*env)[def->name () + " [f]" ] = def;
397404 }
0 commit comments