From 95461a7710c41c73db4c38bbd3f331ba0b0f96e8 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 5 Mar 2017 12:23:14 -0500 Subject: [PATCH] windows-port iterate --- c/lib/mlr_arch.c | 13 +++++++++++ c/lib/mlr_arch.h | 3 +++ c/todo.txt | 58 ++++++++++++++++++++++++++++++------------------ 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/c/lib/mlr_arch.c b/c/lib/mlr_arch.c index 8b7e2faff..3c65ffe43 100644 --- a/c/lib/mlr_arch.c +++ b/c/lib/mlr_arch.c @@ -1 +1,14 @@ +#include +#include +#include "mlr_globals.h" #include "mlr_arch.h" + +// ---------------------------------------------------------------- +int mlr_arch_setenv(const char *name, const char *value, int overwrite) { +#ifdef MLR_ON_MSYS2 + fprintf(stderr, "%s: setenv is not supported on this architecture.\n", MLR_GLOBALS.bargv0); + exit(1); +#else + return setenv(name, value, overwrite); +#endif +} diff --git a/c/lib/mlr_arch.h b/c/lib/mlr_arch.h index 6dc4f7499..352e3b0cd 100644 --- a/c/lib/mlr_arch.h +++ b/c/lib/mlr_arch.h @@ -19,4 +19,7 @@ #include #endif +// ---------------------------------------------------------------- +int mlr_arch_setenv(const char *name, const char *value, int overwrite); + #endif // MLR_ARCH_H diff --git a/c/todo.txt b/c/todo.txt index b3a9f463a..04fc2a76b 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -30,27 +30,43 @@ BUGFIXES ================================================================ MSYS2 -* to do: - ! msys2 / pacman -S / etc @ appveyor - o get_unlocked / getc: - - @ mlr_arch.h: ifdef MSYS2 define getc_unlocked(x) getc(x) - o mman/mmap ifdef out entirely with default --no-mmap. - - @ mlr_arch.h: ifdef MSYS2 undef ENABLE_MMAP - - @ callsites: ifdef ENABLE_MMAP - o setenv w/o gmtime_r - - @ mlr_arch.h: ifdef MSYS2 undef ENABLE_SETENV - - @ callsite: fatal? - o setenv w/ gmtime_r - - figure out how to do this directly on msys2 - - @ mlr_arch.h: proto for plat-indep abstraction layer - - @ mlr_arch_unixish: as now - - @ mlr_arch_msys2: do it that new way. or fatal until then ... or "unimpl" retval. - o -lpcreposix - - found how to do this in ./configure, Makefile.am w/ ifdef, something ... - o needs-DLL issue: - - find out how to fix at ./configure / msys2 build - o needs-dot-exe issue: - - wtf +---------------------------------------------------------------- +MSYS2 TO-DO + +! msys2 / pacman -S / etc @ appveyor + +! getdelim + +! strsep + +k get_unlocked / getc: + k @ mlr_arch.h: ifdef MSYS2 define getc_unlocked(x) getc(x) + +k mman/mmap ifdef out entirely with default --no-mmap. + k @ mlr_arch.h: ifdef MSYS2 undef ENABLE_MMAP + k @ callsites: ifdef ENABLE_MMAP + +* setenv w/o gmtime_r + - @ mlr_arch.h: ifdef MSYS2 undef ENABLE_SETENV + - @ callsite: fatal? + +* setenv w/ gmtime_r + - figure out how to do this directly on msys2 + - @ mlr_arch.h: proto for plat-indep abstraction layer + - @ mlr_arch_unixish: as now + - @ mlr_arch_msys2: do it that new way. or fatal until then ... or "unimpl" retval. + +* -lpcreposix + - found how to do this in ./configure, Makefile.am w/ ifdef, something ... + +* needs-DLL issue: + - find out how to fix at ./configure / msys2 build + +* needs-dot-exe issue: + - wtf + +---------------------------------------------------------------- +MSYS2 NOTES * https://github.com/msys2/msys2/wiki * https://github.com/Alexpux/MINGW-packages