Skip to content

Commit

Permalink
Merge pull request #128 from CapitalID/winx64_fixes
Browse files Browse the repository at this point in the history
Fix sassc build and warnings
  • Loading branch information
xzyfer committed Aug 4, 2015
2 parents 3565df7 + bb67d86 commit 5c78c73
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion sassc.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#ifdef _MSC_VER
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS 1
#endif
#endif

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 9 additions & 1 deletion win/posix/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '+')
Expand Down

0 comments on commit 5c78c73

Please sign in to comment.