From 85fcd74b015da286fe73fa844db5ae334af4d36f Mon Sep 17 00:00:00 2001 From: Henry Roeland Date: Fri, 31 Jul 2015 23:20:21 +0200 Subject: [PATCH 1/2] Fix sassc build and warnings --- sassc.c | 12 +++++++++++- win/posix/getopt.c | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sassc.c b/sassc.c index 4e0f4a1..c2cd6b5 100644 --- a/sassc.c +++ b/sassc.c @@ -1,3 +1,9 @@ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif + #include #include #include @@ -199,7 +205,11 @@ int main(int argc, char** argv) { break; case 'I': if (!include_paths) { - include_paths = strdup(optarg); +#ifdef _MSC_VER + include_paths = _strdup(optarg); +#else + include_paths = strdup(optarg); +#endif } else { char *old_paths = include_paths; include_paths = malloc(strlen(old_paths) + 1 + strlen(optarg) + 1); diff --git a/win/posix/getopt.c b/win/posix/getopt.c index ac1fda4..43710d1 100644 --- a/win/posix/getopt.c +++ b/win/posix/getopt.c @@ -344,8 +344,16 @@ getopt_internal(int nargc, char * const *nargv, const char *options, * CV, 2009-12-14: Check POSIXLY_CORRECT anew if optind == 0 or * optreset != 0 for GNU compatibility. */ - if (posixly_correct == -1 || optreset != 0) + if (posixly_correct == -1 || optreset != 0) { +#ifdef _MSC_VER + size_t requiredSize; + + getenv_s(&requiredSize, NULL, 0, "POSIXLY_CORRECT"); + posixly_correct = requiredSize > 0; +#else posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); +#endif + } if (*options == '-') flags |= FLAG_ALLARGS; else if (posixly_correct || *options == '+') From bb67d86a56fae3d8a3aa508f7eecdcf23e9dcdbd Mon Sep 17 00:00:00 2001 From: Henry Roeland Date: Sat, 1 Aug 2015 14:41:06 +0200 Subject: [PATCH 2/2] Trying to fix the travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e766fb6..e74b5d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - gem install sass - git clone https://github.com/sass/libsass.git - cd libsass && git submodule init && git submodule update && cd .. - - export SASS_LIBSASS_PATH=libsass + - export SASS_LIBSASS_PATH=$TRAVIS_BUILD_DIR/libsass script: - ./script/ci-build-libsass