libuv_prog default c_std: gnu11 is this planned behavior?

Only exploring things a bit now and I got media-soup running off native tools command prompt for VS2019. Using c_std:c99 as default. Avoiding MinGW.

I’m wondering if there’s a reason to use gnu11 over c99 for compiling standards. I haven’t done enough tests so maybe you can shoot this one down or consider it if no problems. I made a pull request I closed because I can’t test beyond windows 10 at the moment (needed more time and a dev area setup).

For testing if I do stuff like this, do the scripts do good enough testing as well (fuzzer/etc)?

What does “compiling standards” mean?

BTW we don’t decide which compiler version to use for libuv. libuv is installed as a Meson dependency and its meson.build is online in the Meson WrapDB registry: Meson WrapDB packages

As I asked in the other topic, what are you trying to do? Can you reproduce the problem the user reported when trying to install mediasoup Rust crate into a Rust project? The issue was not about compiling mediasoup in Windows. I know that building stuff in Windows is hell but that’s not the problem we have. I insist that mediasoup compiles and passes tests in Windows in GH CI actions.

It refers to the C language version or dialect the compiler uses when building the code.

I was just trying to compile in windows the mediasoup-worker into an .exe and managed it without MinGW. This isn’t rust related I don’t think at least, just something I found testing fast. Not sure if gnu11 has an affect if switched over? It’s defaulted to gnu11 so just curious if this is planned behavior or if a default of C99 would work just as good when passing the libuv wrapper.

I just would like to know if gnu11 is absolutely necessary or if c99 would work. (Adds more support if c99 can rock)

I have no idea about that but I’m pretty sure that if libuv authors use gnu11 there is a reason for that. They have a mailing list in case you want to ask.

They don’t set it actually, some wraps may set their own. Libuv will use Meson’s default or user specified option. If you test it and there’s no issues outside small code fix, then it’s ideally the way you want to push going forward for support for Windows, Linux, and Apple devices.

libuv_proj = subproject(
‘libuv’,
default_options: [
‘warning_level=0’,
‘build_tests=false’,
‘build_benchmarks=false’,
‘c_std=c99’,
],
)

I wouldn’t be the best for running tests right now but I would consider this it’s added support. If there’s specifics I can do to test or help let me know I just need to know how it should be tested otherwise it’ll compile.

That’s the thing: I have no idea. And I don’t know why we need to change that. We have no problems compiling mediasoup in any OS including Windows other than the Rust thing reported in another topic.

I don’t articulate these topics well, so I had to think and do more homework.

If mediasoup doesn’t rely on GNU extensions, we don’t need GNU11 or GCC. Meson defaults to GNU11 mainly for practicality when no standard is specified, but GNU can introduce portability issues. Since libuv can compile under strict C99, we only need MSVC or Clang… GCC is optional. Mediasoup already handles and guards POSIX features as needed, and all other subprojects are either C++ or C and already C99-compliant, so the whole build is portable across platforms.

Just an idea, it’s the only subproject I noticed to make the entire project require GCC. Cheers!

I’m aware I did misread the other topic. This was just a discovery that doesn’t need to be taken seriously but if it works, you got better portability and that’s that. May solve some issues long-haul.

Update:
Got a response in libuv discussion: ”We use <stdatomic.h> a fair bit so in that sense libuv is firmly in the realm of C11, although C99 mode probably works on most systems.”

No guarantees but it should probably work in their words.

Cheers!

So what they said is that libuv need C11 but not necessarily gnu11, is that correct?

Said that, Meson configuration in mediasoup doesn’t define a specific C mode to build libuv. I don’t remember if the libuv package in Meson WrapDB specifies gnu11, does it? In other words, when we build mediasoup which C mode is selected to build libuv? And where is it done? Is it the default C mode that Meson uses? Or is a specific C mode setting in libuv Meson settings?

Correct, no mention of GNU extensions so C11 should in theory work on its own. At least that was what they were saying it should probably work no problems.

No, that’s why Meson will default to GNU11. No specified standard by user or the library will default it to GNU11 from what I read/gathered.

GNU11 defaulted cause there’s no specified build standard.

worker/meson.build we can apply our default_settings there. Line 253~

I’ll be busy for some days. Can you please open an issue in GitHub with the summary of this?

Yes, I wanted to learn how to use Github properly, thus the accidental push early. Work in progress.. :smiley:

I’d want to test Windows 10 and 11 and Linux (uBuntu or w/e you guys suggest – can’t do iOS/apple). Goal is perform the tests with demo (or whatever is encouraged by you guys to test/fuzz) if there’s no inherent issue on any of the operating systems I’ll submit a request for you guys to test out and determine.

So on that note if there’s a specific way to test the features for functionality with demo or however let me know I’ll find time to explore this more and help on the windows side of things and overall portability.