Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sassc build and warnings #128

Merged
merged 2 commits into from Aug 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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