summaryrefslogtreecommitdiff
path: root/solenv/bin
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2013-03-02 15:28:26 -0500
committerAndras Timar <atimar@suse.com>2013-03-04 12:52:00 +0000
commit6398cf9f874cf0879151d70e9f63f7b8d53b30e0 (patch)
treeaeaccb3826d0bb2fd99dd5ec0886b0179d354329 /solenv/bin
parent52db503897de94deae3121e1ce194c88b517f300 (diff)
do not require cygwin gcc
Change-Id: I29de91f2eeb5c9317271aecf861f64a3c8eff73f Reviewed-on: https://gerrit.libreoffice.org/2521 Reviewed-by: Michael Meeks <michael.meeks@suse.com> Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'solenv/bin')
-rw-r--r--solenv/bin/concat-deps.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 5b478aa822fa..5782f66e10b2 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -30,12 +30,12 @@
#define USE_MEMORY_ALIGNMENT 4
#endif /* Def _AIX */
-#ifdef __CYGWIN__
+#ifdef _MSC_VER
#define __windows
#define CORE_BIG_ENDIAN 0
#define CORE_LITTLE_ENDIAN 1
#define USE_MEMORY_ALIGNMENT 64 /* big value -> no alignment */
-#endif /* Def __CYGWIN__ */
+#endif /* Def _MSC_VER */
#if defined(__linux) || defined(__OpenBSD__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || \
@@ -97,7 +97,10 @@
#ifdef __windows
#define FILE_O_RDONLY _O_RDONLY
#define FILE_O_BINARY _O_BINARY
-#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */
+#define PATHNCMP _strnicmp /* MSVC converts paths to lower-case sometimes? */
+#define inline __inline
+#define ssize_t long
+#define S_ISREG(mode) (((mode) & _S_IFMT) == (_S_IFREG)) /* MSVC does not have this macro */
#else /* not windaube */
#define FILE_O_RDONLY O_RDONLY
#define FILE_O_BINARY 0
@@ -775,10 +778,17 @@ static void emit_unpacked_target(char const*const token, char const*const end)
{
/* is there some obvious way to printf N characters that i'm missing? */
size_t size = end - token + 1;
- char tmp[size];
+ char* tmp=(char *)malloc(size*sizeof(char));
+ #ifdef _MSC_VER
+ // MSVC _snprintf doesn't null terminate strings
+ _snprintf(tmp, size, "%s", token);
+ tmp[size-1]='\0';
+ #else
snprintf(tmp, size, "%s", token);
+ #endif
fputs(tmp, stdout);
fputs(".done ", stdout);
+ free(tmp);
}
/* prefix paths to absolute */
@@ -787,6 +797,7 @@ static inline void print_fullpaths(char* line)
char* token;
char* end;
int boost_count = 0;
+ int token_len;
const char * unpacked_end = 0; /* end of UnpackedTarget match (if any) */
/* for UnpackedTarget the target is GenC{,xx}Object, dont mangle! */
int target_seen = 0;
@@ -805,7 +816,7 @@ static inline void print_fullpaths(char* line)
while (*end && (' ' != *end) && ('\t' != *end) && (':' != *end)) {
++end;
}
- int token_len = end - token;
+ token_len = end - token;
if (target_seen &&
elide_dependency(token, token_len, &unpacked_end))
{
@@ -855,8 +866,9 @@ static inline void print_fullpaths(char* line)
static inline char * eat_space_at_end(char * end)
{
+ char * real_end;
assert('\0' == *end);
- char * real_end = end - 1;
+ real_end = end - 1;
while (' ' == *real_end || '\t' == *real_end || '\n' == *real_end
|| ':' == *real_end)
{ /* eat colon and whitespace at end */