Open LoganDark opened 6 years ago
I dont have complete support for mac, and I don't plan to add it myself. I have cleaned up a lot of the warnings your compiler is giving (mine doesn't give any)
I have added an if apple
around some of the code that would have to be ported for mac (the winch code, specifically)
But the ValuePack::push_ret variadric template methods should compile just fine. I dont know what is wrong with the xcode toolchain and why it doesn't understand it.
If you have a macOS version, can I have it then? :P
Because it seems like my compiler just doesn't like the code...
I don't have another version of the code. I use g++ 8.1.0 and 8.20 on linux (gentoo and ubuntu).
Okay, well then your claim that you "cleaned up a lot of the warnings [the] compiler is giving" is completely invalid. You're not using macOS, so you can't vouch for it using another OS.
While macOS is very POSIX-like, it isn't by any means equivalent to Linux. The tools are not the same. Especially since Apple is very, very bad at providing good developer tools.
I did test again with some more recent commits, still no luck.
0 LoganDark ~/ocvm git pull origin master
remote: Counting objects: 138, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 138 (delta 112), reused 138 (delta 112), pack-reused 0
Receiving objects: 100% (138/138), 19.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (112/112), completed with 45 local objects.
From https://github.com/payonel/ocvm
* branch master -> FETCH_HEAD
e49e1c5..41bf80a master -> origin/master
Updating e49e1c5..41bf80a
Fast-forward
.gitignore | 2 +-
.vscode/c_cpp_properties.json | 79 ---------------------
.vscode/launch.json | 2 +-
.vscode/settings.json | 16 ++++-
Makefile | 45 ++++++++----
apis/userdata.h | 15 ++++
components/computer.cpp | 2 +
components/computer.h | 3 +-
components/eeprom.cpp | 2 +
components/eeprom.h | 2 +
components/filesystem.cpp | 9 ++-
components/filesystem.h | 2 +
components/gpu.cpp | 5 +-
components/gpu.h | 2 +
components/internet.cpp | 13 ++--
components/internet.h | 2 +
components/keyboard.cpp | 3 +
components/keyboard.h | 2 +
components/modem.cpp | 9 +++
components/modem.h | 3 +
components/sandbox.cpp | 14 +++-
components/sandbox.h | 3 +-
components/screen.cpp | 19 +++++
components/screen.h | 10 ++-
drivers/ansi.h | 2 +-
drivers/ansi_escape.cpp | 2 +
drivers/fs_utils.cpp | 2 +-
drivers/internet_drv.cpp | 314 +++++++++++-----------------------------------------------------------------------
drivers/internet_drv.h | 78 +++++++++------------
drivers/internet_http.cpp | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/internet_http.h | 39 +++++++++++
drivers/kb_data.cpp | 11 ++-
drivers/kb_drv.h | 1 +
drivers/raw_tty.cpp | 19 ++++-
drivers/worker.cpp | 2 +-
io/frame.cpp | 10 ++-
io/frame.h | 13 +++-
model/client.cpp | 12 +++-
model/client.h | 1 -
model/host.cpp | 76 ++++++++------------
model/host.h | 14 ++++
model/prof_log.cpp | 2 +-
42 files changed, 643 insertions(+), 502 deletions(-)
delete mode 100644 .vscode/c_cpp_properties.json
create mode 100644 drivers/internet_http.cpp
create mode 100644 drivers/internet_http.h
0 LoganDark ~/ocvm env PKG_CONFIG_PATH=/usr/local/Cellar/lua/5.2.4_4/lib/pkgconfig/ make
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c main.cpp -o bin/main.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c apis/unicode.cpp -o bin/apis/unicode.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c apis/userdata.cpp -o bin/apis/userdata.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/component.cpp -o bin/components/component.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/computer.cpp -o bin/components/computer.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/eeprom.cpp -o bin/components/eeprom.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/filesystem.cpp -o bin/components/filesystem.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/gpu.cpp -o bin/components/gpu.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/internet.cpp -o bin/components/internet.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/keyboard.cpp -o bin/components/keyboard.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/modem.cpp -o bin/components/modem.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/sandbox.cpp -o bin/components/sandbox.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c components/screen.cpp -o bin/components/screen.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c io/frame.cpp -o bin/io/frame.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/ansi.cpp -o bin/drivers/ansi.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/ansi_escape.cpp -o bin/drivers/ansi_escape.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/basic_term.cpp -o bin/drivers/basic_term.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/factory_shell.cpp -o bin/drivers/factory_shell.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/fs_utils.cpp -o bin/drivers/fs_utils.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/internet_drv.cpp -o bin/drivers/internet_drv.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/internet_http.cpp -o bin/drivers/internet_http.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/kb_data.cpp -o bin/drivers/kb_data.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/kb_drv.cpp -o bin/drivers/kb_drv.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/raw_tty.cpp -o bin/drivers/raw_tty.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/term_buffer.cpp -o bin/drivers/term_buffer.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c drivers/worker.cpp -o bin/drivers/worker.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c model/client.cpp -o bin/model/client.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c model/host.cpp -o bin/model/host.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c model/log.cpp -o bin/model/log.o
c++ -g --std=c++17 -Wall -I/usr/local/opt/lua/include -I. -MMD -c model/prof_log.cpp -o bin/model/prof_log.o
drivers/ansi_escape.cpp:59:9: error: use of undeclared identifier 'sigtimedwait'
if (sigtimedwait(&g_sigset, nullptr, &timeout) == SIGWINCH) // winched
^
components/sandbox.cpp:55:39: warning: 'create_object' has C-linkage specified, but returns incomplete type
'std::unique_ptr<Component>' which could be incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::unique_ptr<Component> create_object()
^
components/sandbox.cpp:60:24: warning: 'name' has C-linkage specified, but returns user-defined type 'std::string' (aka
'basic_string<char, char_traits<char>, allocator<char> >') which is incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::string name()
^
components/filesystem.cpp:44:13: warning: implicit conversion of nullptr constant to 'bool' [-Wnull-conversion]
if (nullptr || _fs == nullptr)
^~~~~~~ ~~
false
1 error generated.
make: *** [bin/drivers/ansi_escape.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from drivers/internet_drv.cpp:1:
In file included from drivers/internet_drv.h:3:
In file included from ./apis/userdata.h:3:
In file included from ./model/luaproxy.h:7:
./model/value.h:176:48: error: no matching function for call to 'push_ret'
return ValuePack::push_ret(lua, arg) + ValuePack::push_ret(lua, args...);
^~~~~~~~~~~~~~~~~~~
./model/value.h:98:27: note: in instantiation of function template specialization 'ValuePack::push_ret<unsigned long>'
requested here
return ValuePack::push_ret(lua, args...);
^
drivers/internet_drv.cpp:125:23: note: in instantiation of function template specialization
'ValuePack::ret<unsigned long>' requested here
return ValuePack::ret(lua, buffer.size());
^
./model/value.h:174:23: note: candidate function template not viable: requires at least 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const T& arg, const Ts&... args)
^
./model/value.h:101:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, bool arg)
^
./model/value.h:107:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int32_t arg)
^
./model/value.h:113:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint32_t arg)
^
./model/value.h:119:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int64_t arg)
^
./model/value.h:125:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint64_t arg)
^
./model/value.h:131:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, double arg)
^
./model/value.h:137:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, float arg)
^
./model/value.h:143:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const string& arg)
^
./model/value.h:149:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const char* arg)
^
./model/value.h:155:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const void* arg)
^
./model/value.h:161:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const vector<char>& arg)
^
./model/value.h:167:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const Value& v)
^
1 error generated.
make: *** [bin/drivers/internet_drv.o] Error 1
2 warnings generated.
In file included from components/modem.cpp:2:
In file included from components/modem.h:3:
In file included from components/component.h:5:
./model/value.h:176:48: error: no matching function for call to 'push_ret'
return ValuePack::push_ret(lua, arg) + ValuePack::push_ret(lua, args...);
^~~~~~~~~~~~~~~~~~~
./model/value.h:98:27: note: in instantiation of function template specialization 'ValuePack::push_ret<unsigned long>'
requested here
return ValuePack::push_ret(lua, args...);
^
components/modem.cpp:186:23: note: in instantiation of function template specialization 'ValuePack::ret<unsigned long>'
requested here
return ValuePack::ret(lua, _maxPacketSize);
^
./model/value.h:174:23: note: candidate function template not viable: requires at least 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const T& arg, const Ts&... args)
^
./model/value.h:101:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, bool arg)
^
./model/value.h:107:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int32_t arg)
^
./model/value.h:113:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint32_t arg)
^
./model/value.h:119:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int64_t arg)
^
./model/value.h:125:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint64_t arg)
^
./model/value.h:131:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, double arg)
^
./model/value.h:137:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, float arg)
^
./model/value.h:143:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const string& arg)
^
./model/value.h:149:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const char* arg)
^
./model/value.h:155:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const void* arg)
^
./model/value.h:161:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const vector<char>& arg)
^
./model/value.h:167:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const Value& v)
^
In file included from apis/unicode.cpp:1:
In file included from apis/unicode.h:2:
In file included from ./model/luaproxy.h:7:
./model/value.h:176:48: error: no matching function for call to 'push_ret'
return ValuePack::push_ret(lua, arg) + ValuePack::push_ret(lua, args...);
^~~~~~~~~~~~~~~~~~~
./model/value.h:98:27: note: in instantiation of function template specialization 'ValuePack::push_ret<unsigned long>'
requested here
return ValuePack::push_ret(lua, args...);
^
apis/unicode.cpp:375:23: note: in instantiation of function template specialization 'ValuePack::ret<unsigned long>'
requested here
return ValuePack::ret(lua, wlen(Value::checkArg<vector<char>>(lua, 1)));
^
./model/value.h:174:23: note: candidate function template not viable: requires at least 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const T& arg, const Ts&... args)
^
./model/value.h:101:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, bool arg)
^
./model/value.h:107:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int32_t arg)
^
./model/value.h:113:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint32_t arg)
^
./model/value.h:119:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int64_t arg)
^
./model/value.h:125:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint64_t arg)
^
./model/value.h:131:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, double arg)
^
./model/value.h:137:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, float arg)
^
./model/value.h:143:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const string& arg)
^
./model/value.h:149:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const char* arg)
^
./model/value.h:155:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const void* arg)
^
./model/value.h:161:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const vector<char>& arg)
^
./model/value.h:167:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const Value& v)
^
1 error generated.
make: *** [bin/apis/unicode.o] Error 1
1 error generated.
make: *** [bin/components/modem.o] Error 1
In file included from components/filesystem.cpp:1:
In file included from components/filesystem.h:2:
In file included from components/component.h:5:
./model/value.h:176:48: error: no matching function for call to 'push_ret'
return ValuePack::push_ret(lua, arg) + ValuePack::push_ret(lua, args...);
^~~~~~~~~~~~~~~~~~~
./model/value.h:98:27: note: in instantiation of function template specialization 'ValuePack::push_ret<unsigned long>'
requested here
return ValuePack::push_ret(lua, args...);
^
components/filesystem.cpp:567:23: note: in instantiation of function template specialization
'ValuePack::ret<unsigned long>' requested here
return ValuePack::ret(lua, fs_utils::size(path() + clean(filepath, true, false)));
^
./model/value.h:174:23: note: candidate function template not viable: requires at least 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const T& arg, const Ts&... args)
^
./model/value.h:101:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, bool arg)
^
./model/value.h:107:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int32_t arg)
^
./model/value.h:113:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint32_t arg)
^
./model/value.h:119:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, int64_t arg)
^
./model/value.h:125:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, uint64_t arg)
^
./model/value.h:131:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, double arg)
^
./model/value.h:137:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, float arg)
^
./model/value.h:143:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const string& arg)
^
./model/value.h:149:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const char* arg)
^
./model/value.h:155:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const void* arg)
^
./model/value.h:161:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const vector<char>& arg)
^
./model/value.h:167:23: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline static int push_ret(lua_State* lua, const Value& v)
^
1 warning and 1 error generated.
make: *** [bin/components/filesystem.o] Error 1
Also, I decided to put all the mile-tall code blocks inside my posts into <details> elements :p
Okay, well then your claim that you "cleaned up a lot of the warnings [the] compiler is giving" is completely invalid. You're not using macOS, so you can't vouch for it using another OS.
Haha, it's not completely invalid :) I read the warnings and cleaned up the code they referred to. If you try to build again with latest, there will be fewer warnings, and 1 fewer error
Anyways, while I hope for macos support, it's not in my plans. Also because I dont have a personal mac for testing/porting.
I dont have a personal mac for testing/porting.
I would actually be completely fine with donating my machine to you during the day when I'm usually asleep if I'm able to fix my schedule.
Remote desktop is a thing :P
if this hasn't been fixed with a newer macos version (which i think it might've) it might be worth testing with a newer version of clang/gcc available through Homebrew if you haven't done it already, and if you're still interested in this.
There are so many errors here I don't really care to look through them and separate them out.
Output