Comments (7)
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.
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.
@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 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.
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.
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.
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)
- A little problem about hashmap HOT 2
- question: why pass by reference in `sc_str_substring((char** str, uint32_t start, uint32_t end)`? HOT 6
- test
- Using this lib over FetchContent HOT 5
- Compile errors on Release HOT 7
- sc_str_append_fmt is trimming whitespaces at the end of the formated strings HOT 3
- Add shrink option to sc_buf
- [error]“afunix.h”: No such file or directory sc_socket_test HOT 2
- What does this function? HOT 17
- EPOLLET in non-blocking sc_sock HOT 10
- Any plans on implementing AVL tree? HOT 5
- sc_array.h: error: implicit declaration of function 'memmove' HOT 3
- sc_sock: WSAPoll is broken HOT 2
- sc_sock thread-safety HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sc.