Conversation
Haider982
left a comment
There was a problem hiding this comment.
You should add a few comments to help those who stumble into here not delete it.
Delete what? |
|
The program works on windows though already? I've compiled it from source just now, all you need is the Git Bash (to run the build.sh script) and the gcc compiler (i use w64devkit, it has everything you need bundled in a neat lil package :) |
I used Mingw and it refused to compile without these changes |
Then change the issue title to be more adequate, say "Fix bareiron not building on mingw", or "Add mingw support" |
Mingw is the standard way to use GCC for Windows, see the GCC website. I think the current title suffices. Expecially as this also brings MSVC support a lot closer. |
It seems to be using GCC with some extra stuff bundled in because standard Mingw with some additional packages wont compile. Besides I don't think the pull request name is that important. |
Mingw-w64≠Mingw |
Then use MinGW-w64 and not some obsolete distribution 😂 |
p2r3
left a comment
There was a problem hiding this comment.
Indentation seems to be misaligned. This project uses 2-space indentation, I think you're using tabs?
That's just the Github IDE Albeit in general I think tabs are superior to spaces. |
I used the official Mingw distribution that GCC reccommends |
As the contribution guidelines state, follow the existing code style, even if you disagree with it. |
Fixed. |
|
FWIW I had no issues compiling on windows using the exact instructions in the README, and I also had no issues with the MinGW bundled with CLion. I am curious what kind of compiler errors you had with your MinGW version? That all being said I think using the proper windows error handling is probably best even if it does muddy up the code. Not a huge deal but it is recommended to use the WIN32 SOCKET_ERROR enum over just relying on -1 so intent is clear but it's not a hill I'd die on and POSIX relies on the -1 Finally, the indentation still isn't 100% perfect from what I see |
Try the official MinGW, the programs suggested in the comments are either Cygwin or mingw-w64 variants.
I didn't find indentation issues in the code but feel free to point out if you find any ;)
I don't remember the exact error but I recall the fix was to use a discontinued package for MinGW which was no longer available and thus could not be fixed. |
|
Also to mention that this pull makes possible MSVC build support easier expecially by introducing the Windows specific clock function |

This makes bareiron be able to be compiled for Windows by using WSA alternatives for connection data and having a custom implementation for
get_program_timefor Windows/NT platforms.Also this was a pain to make and debug lol
Proof:
