Fix some Windows build issues.
This commit is contained in:
parent
9369d6db57
commit
c3d5b23ac4
|
|
@ -195,4 +195,16 @@ inline int64_t i64round(double x)
|
|||
#define TU ""
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
# include <string.h>
|
||||
static inline char*strndup(const char*s, size_t n)
|
||||
{
|
||||
if (strlen(s) < n) return strdup(s);
|
||||
char*tmp = (char*)malloc(n);
|
||||
strncpy(tmp, s, n);
|
||||
tmp[n-1] = 0;
|
||||
return tmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IVL_config_H */
|
||||
|
|
|
|||
|
|
@ -102,13 +102,13 @@ void vpip_add_env_and_default_module_paths()
|
|||
s = strrchr(basepath, '\\');
|
||||
if (s) *s = 0;
|
||||
else {
|
||||
fprintf(stderr, "%s: Missing first \\ in exe path!\n", argv[0]);
|
||||
fprintf(stderr, "%s: Missing first \\ in exe path!\n", tmp);
|
||||
exit(1);
|
||||
}
|
||||
s = strrchr(basepath, '\\');
|
||||
if (s) *s = 0;
|
||||
else {
|
||||
fprintf(stderr, "%s: Missing second \\ in exe path!\n", argv[0]);
|
||||
fprintf(stderr, "%s: Missing second \\ in exe path!\n", tmp);
|
||||
exit(1);
|
||||
}
|
||||
strcat(s, "\\lib\\ivl" IVL_SUFFIX);
|
||||
|
|
|
|||
Loading…
Reference in New Issue