Thinking again about this project idea I have where I'd use Allegro and release simultaneously on DOS and modern
As great as it is that Allegro 4 still runs on modern systems, I wonder how much of a hassle it would be to use directives in the backend to use either 4 or 5 depending on the target platform. I could then write a header that my actual engine and game code interfaces with, so it wouldn't have to change
The backend code would be a mess of #ifdefs, but everything else could stay clean
sys/arch/aarch64/include: pmap_machdep.h
skrll: Reduce #ifdefs
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/aarch64/include/pmap_machdep.h.diff?r1=1.5&r2=1.6
@brynet @benjamineskola @judfilm @brightside
Of course it's going to have #ifdefs. It does PAM on systems with OpenPAM and LinuxPAM and BSD Auth on OpenBSD. It's a fairly superficial analysis to say that something is problematic because it has #ifdef __Linux__. Indeed, that's the same level of analysis as the OpenDoas author wholesale deleting all the code that's behind #ifdef __OpenBSD__, the exact commit for which is earlier in this very thread.
@mcc Most of what I do isn't heavily platform-y, but https://github.com/emilk/egui/tree/0.18.0 just kinda made sense to me, although they've restructured since - https://github.com/emilk/egui .
Personally I'd call them
/blah (or /blah-lib or /blah-core)
/blah-web
/blah-exe
Reading your objections, I wonder why I'm ok with it. I think it's also a garbage C experience, except in my case it's all the platforms mangled together via #ifdefs . It's left me wanting systems with (excessively?) clear separation/layers.
@StompyRobot I found the root of the problem. It was the mutex after all. UE4 wraps PhysX’s mutex and locks it per ray. Relocking it appears to be free so I wasn’t completely off base with pre-locking it.
The final solution is to divide the work into blocks, parallel-for over the blocks, lock the mutex at the start of the block, regular for-loop over the work in the block, unlock the mutex, and finish.
It’s a bit janky because the PhysX mutex needs ugly #ifdefs, but it works.
The problem is that almost nobody does this.
Most C written in this millenia is either a pile of #ifdefs or hard-depends on Linux or GNU.
That which isn't almost certainly depends on POSIX, if not X/Open or BSD (yes, a lot of *Linux* code depends on BSD APIs.)
Learning POSIX is, in many ways, more important than learning the C syntax and semantics.
This is literally the first time I've logged into an instance on the iOS version of my mastodon client.
I've spend zero effort on iOS except making sure it compiles (a handful of #ifdefs)
And I am pleasantly surprised how well it is working.
SwiftUI truly is something special.
This is literally the first time I've logged into an instance on the iOS version of my mastodon client.
I've spent zero effort on iOS except making sure it compiles (a handful of #ifdefs)
And I am pleasantly surprised how well it is working.
SwiftUI truly is something special.
@eregon https://github.com/lattera/glibc/blob/895ef79e04a953cac1493863bcae29ad85657ee1/libio/stdio.h#L113
It's another seek mode for fseek(). Not sure what "Seek to next data" really means, but it's supported by glibc. and CRuby has some #ifdefs for SEEK_DATA in io.c.
https://github.com/ruby/ruby/blob/bbc4cf5f76c0e17e645ba81ae0b3625c8cbfc4c4/io.c#L207-L209
Which means even when I pass the correct build tags, gcc is being called with the flags set by the wrong build tags, and all the #ifdefs are wrong as a result
Sick And Tired of opening "cross platform" C++ files to find the 'abstraction' level to be #ifdefs 🙄
Looks like someone ran a badly formulated mail merge on a random mix of source sets. 🤮
The abstractions are right there, in the language (and has been for ages), to do this properly.
I think I'll switch from Deadbeef to MPD as music player simply because that offers a simple way to query the playing song via a socket.
Deadbeef can do it too but it seems the simplest way they offer is via dbus, which seems like terrible overkill. I'd be happy with something as simple as writing the current song to a file but for that it seems I'd have to refresh my C skills and write a plugin. It has a stdio 'plugin' built in but that can only read files and has more #ifdefs than anything.
I think I'll switch from Deadbeef to MPD as music player simply because that offers a simple way to query the playing song via a socket.
Deadbeef can do it too but it seems the simplest way they offer is via dbus, which seems like terrible overkill. I'd be happy with something as simple as writing the current song to a file but for that it seems I'd have to refresh my C skills and write a plugin. It has a stdio 'plugin' built in but that can only read files and has more #ifdefs than anything.
@psychotea Hey, thanks! I didn't notice new kernel sources are up. I'll update the indexer with new sources in the next few days!
For iOS and XNU versions, aren't they the same? I'm taking the sources from here:
https://opensource.apple.com/release/macos-10136.html
There is only 'xnu' package, and inside the sources are numerous #ifdefs to check if the kernel is being compiled for iOS. So isn't this kernel source the same for macOS and iOS?
Diving further into that code, I find they took my advice from a few years ago to use classes to manage their C++ code...
... but didn't use any subclasses. Instead, they have FooHelper.h, which #ifdefs the public class methods for each Foo-class variant to macros like FOO_INIT, FOO_SETUP, FOO_RUNFOO, FOO_SET_PARAM, and so on for each of a number of classes. There's also a FooHelper.cpp, which implements the parts of that whackyness which don't fit neatly into macros.
@Gargron @gingerrroot People are often very averse to *any* change. I agree with your example: I'm certain lots of people would be against a public timeline if it were introduced only now. Sometimes the only way to move forward in face of such "conservative" backlash is to fill the code with "#ifdefs" and make everything optional (or move to a plugin architecture). It's more code maintenance burden, but it shifts the userbase management burden...