Git Product home page Git Product logo

Comments (7)

tezc avatar tezc commented on July 3, 2024 1

Okay, I see, thank you. I guess it must be done in other files as well. I think proper way to do it is adding a mingw build to the CI and fix all the compile issues. If you feel like doing it, please go ahead and create a PR :) Otherwise, I'm not sure when I'll have some time to do it. Let's leave the issue open until we fix it.

from sc.

tezc avatar tezc commented on July 3, 2024 1

I mentioned tested environments here: https://github.com/tezc/sc#test

So, CI runs on Linux, Windows, MacOS (fork of a BSD) and on FreeBSD. Primary focus is Linux ofcourse. We've never used these libraries on Cygwin, Mingw or on Solaris. So, these are not among our target environments.

sc_sock is not an easy-use library itself. Main focus is Linux but it also works on above OSes. Support for other OSes are just to make development easier and it helps with testing.

If you are going to use these OS specific libraries with another environment like Cygwin or Mingw, you need to make some adjustments in the code unfortunately.

from sc.

tezc avatar tezc commented on July 3, 2024

@jpgpng Yes, you're right. I didn't try with mingw and I don't have any intention to support it to be honest. If it requires minor tweaks, it is okay, we can merge it. If it requires bigger changes, I can't promise anything. I don't have time to setup a mingw environment and maintain the compatibility. Contributions are welcome though, so, feel free to send fixes :)

from sc.

jpgpng avatar jpgpng commented on July 3, 2024

@jpgpng Yes, you're right. I didn't try with mingw and I don't have any intention to support it to be honest. If it requires minor tweaks, it is okay, we can merge it. If it requires bigger changes, I can't promise anything. I don't have time to setup a mingw environment and maintain the compatibility. Contributions are welcome though, so, feel free to send fixes :)

I understand. MinGW-W64 supports two thread model: one is Win32 like MSVC and one is POSIX thread. The one I'm using is POSIX thread and most MinGW-W64 distributions out there are also using POSIX thread. To cover this, one only has to tweak the checking a bit by also cover #if defined(__MINGW32__) as __MINGW32__ is defined on both MinGW-W64 32 bit and 64 bit.

from sc.

jpgpng avatar jpgpng commented on July 3, 2024

Okay, I see, thank you. I guess it must be done in other files as well. I think proper way to do it is adding a mingw build to the CI and fix all the compile issues. If you feel like doing it, please go ahead and create a PR :) Otherwise, I'm not sure when I'll have some time to do it. Let's leave the issue open until we fix it.

Well, I think your library is too Linuxism. I tried to compile on Cygwin which is a full POSIX environment and it failed at sc_socket (sc_sock.c) with error regarding sc_sock_notify_systemd (do we have anything to do with systemd at all?). This means it will very likely to also fail on other POSIX systems like BSDs and Solaris. In summary, it will fail on any platforms that is not Linux.

from sc.

jpgpng avatar jpgpng commented on July 3, 2024

I just find out another problem at line 53 of sc_sock.h. MinGW-W64 doesn't support this pragma (it seems it will just ignore this pragma altogether but I'm not sure): #pragma comment(lib, "ws2_32.lib")

If you want to cover MinGW-W64 you need to move this logic to CMakeLists.txt.

from sc.

jpgpng avatar jpgpng commented on July 3, 2024

If you are going to use these OS specific libraries with another environment like Cygwin or Mingw, you need to make some adjustments in the code unfortunately.

I understand. Thank you. BTW, MinGW-W64 is not a POSIX environment like Cygwin, the binary compiled by it is a native Win32 application that doesn't link with cygwin1.dll nor msys-2.0.dll. I think you confused MinGW-W64 with MSYS2.

Update: almost no one uses the original mingw and msys anymore, it's all MinGW-W64 and MSYS2 nowadays. Perhaps you should mention that it only supports MSVC on Windows in README.md.

from sc.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.