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

Support Windows #30

Open
ghost opened this issue Jul 19, 2020 · 16 comments
Open

Support Windows #30

ghost opened this issue Jul 19, 2020 · 16 comments

Comments

@ghost
Copy link

ghost commented Jul 19, 2020

It would lift the library to the next level.

Windows Server 2019 is perfectly capable for server programs!

@matt-42
Copy link
Owner

matt-42 commented Jul 19, 2020

Hi @FastInvite2k2 ,

This is something we can investigate. I don't know much about the windows networking and async IO API but I can have a look.
The only part that requires a rewrite for windows is the async TCP server, and it's seems possible reading this:

If anyone has experience with windows network programming, help is welcome!

@ghost
Copy link
Author

ghost commented Jul 19, 2020

You could add support for libuv and have async I/O for all relevant platforms!

@alystair
Copy link

Does it already function via WSL2?

@matt-42
Copy link
Owner

matt-42 commented Aug 29, 2020

I never tried but it should no? Is there any program running on linux that does not run under WSL2 ?

@frithrah
Copy link

frithrah commented Sep 5, 2020

I'm curious if li::sql has been tested under Windows. I like the look of the API.

@matt-42
Copy link
Owner

matt-42 commented Sep 7, 2020

It used to be but not anymore (I guess few compilation errors has to be solved first). Several people asked for windows/macos support so I'll set this as my priority.

@matt-42 matt-42 modified the milestones: 0.2, 0.1 Sep 7, 2020
@matt-42 matt-42 changed the title Add support for Windows Add Windows support Sep 8, 2020
@matt-42 matt-42 changed the title Add Windows support Support Windows Sep 8, 2020
@ckaminski
Copy link

I wonder if this might help speed up a windows port?
https://github.com/piscisaureus/wepoll

"This library implements the epoll API for Windows applications. It is fast and scalable, and it closely resembles the API and behavior of Linux' epoll."

@matt-42
Copy link
Owner

matt-42 commented Sep 28, 2020

Thanks @ckaminski this looks great. I think use wepoll to quickly get windows support.

@matt-42
Copy link
Owner

matt-42 commented Sep 29, 2020

I started working on it but it seems like there is a bug in the MSVC compiler. The following code fails to compile and I can't find any workaround:

template <typename... Ms> struct metamap;
template <typename M1, typename... Ms> struct metamap<M1, Ms...> : public M1, Ms... {
    metamap(typename M1::test_type&& m, typename Ms::test_type&&... x) {}
};

int main() {}
example.cpp

<source>(14): error C3543: 'metamap<M1,Ms...>::Ms::test_type &&': does not contain a parameter pack

<source>(15): note: see reference to class template instantiation 'metamap<M1,Ms...>' being compiled

Compiler returned: 2

I sent a bug report hope they will fix it pretty soon...
https://developercommunity.visualstudio.com/content/problem/1203865/c-compilation-bug-parameter-pack-in-constructor-wi.html

@matt-42
Copy link
Owner

matt-42 commented Oct 8, 2020

Since we'll probably have to wait for quite some time for the MSVC bug to get fixed. I'll delay windows support to an future release.

@matt-42 matt-42 removed this from the 0.1 milestone Oct 8, 2020
@chausner
Copy link

The following workaround seems to compile, tested using Compiler Explorer:

template <typename... Ms> struct metamap;
template <typename M1, typename... Ms> struct metamap<M1, Ms...> : public M1, Ms... {
    template <typename M>
    using TestType = typename M::test_type;

    metamap(TestType<M1>&& m, TestType<Ms>&&... x);
};

int main() {}

@matt-42
Copy link
Owner

matt-42 commented Mar 1, 2021

Thanks @chausner ! Seems like this unblock the progress on the windows support.

@testmana2
Copy link

Would you use boost::asio as the network backend for cross platform?

@raul-guerrero
Copy link

raul-guerrero commented Apr 16, 2021

Would you use boost::asio as the network backend for cross platform?

Although would make things somewhat "easier", it also carries a lot of baggage, it has many issues on its own, and being honest, I think lithium is great exactly because of that lack of baggage, it just adds the dependencies that are absolutely needed for doing what it does, and nothing more, which in part is what contributes to its success.

I support doing things adaptive instead of prescriptive, implement just what you need and nothing more, rather than including a library or framework and working around shoehorning the app into such dependencies.

@vanehu
Copy link

vanehu commented Dec 22, 2021

template
struct m_traits {
using iod_value_type = typename M::_iod_value_type;
};

constexpr inline metamap(typename m_traits::iod_value_type &&m1,
typename m_traits::iod_value_type &&... members) : M1{m1}, Ms{std::forward<typename m_traits::iod_value_type>(members)
}... {}
constexpr inline metamap(M1 && m1, Ms && ... members) : M1(m1), Ms(std::forward(members))... {}
constexpr inline metamap(const M1 & m1, const Ms & ... members) : M1(m1), Ms((members))... {}

        // Assignemnt ?

        // Retrive a value.
        template <typename K> constexpr decltype(auto) operator[](K k) {
        return symbol_member_access(*this, k);
    }

fix windows build template error

@matt-42
Copy link
Owner

matt-42 commented Feb 7, 2022

Thanks @vanehu the master branch now compile on windows but there is still bugs. I'll work more on this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants