Skip to content

Conversation

@cctv130
Copy link

@cctv130 cctv130 commented Oct 26, 2025

No description provided.

@jit-ci
Copy link

jit-ci bot commented Oct 26, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@michael-grunder
Copy link
Collaborator

michael-grunder commented Oct 27, 2025

I know very little about MinGW, but is there a simpler strategy?

Instead of defining usleep when in Windows, could we instead just modify millisleep to be this:

static void millisleep(int ms)
{
#if defined(_WIN32)
    Sleep(ms);
#else
    usleep(ms*1000);
#endif
}

And then add an #include <windows.h> at the top of test.c after our #ifdef _WIN32?

One other tiny thing is your editor is adding windows line breaks \r\n whereas this just wants \n.

#define connect(sockfd, addr, addrlen) win32_connect(sockfd, addr, addrlen)
#define getsockopt(sockfd, level, optname, optval, optlen) win32_getsockopt(sockfd, level, optname, optval, optlen)
#define setsockopt(sockfd, level, optname, optval, optlen) win32_setsockopt(sockfd, level, optname, optval, optlen)
#if defined(_WIN32) && !defined(__MINGW32__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if defined(_WIN32) && !defined(__MINGW32__)
#if !defined(__MINGW32__)

I think we're already in an #else block of #ifndef _WIN32?

@cctv130
Copy link
Author

cctv130 commented Oct 27, 2025

I plan to abandon mingw, so I close this PR.

@cctv130 cctv130 closed this Oct 27, 2025
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

Successfully merging this pull request may close these issues.

2 participants