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 , but everything else could stay clean

#ifdefs

Last updated 1 year ago

Rich Felker · @dalias
2005 followers · 16410 posts · Server hachyderm.io

@bugaevc @js @ariadne @megmac It'd be neat if it could emit the C with for wordsize and stuff so as to have the emitted C be essentially portable. IOW delay evaluation of these things to the time the C is preprocessed rather than doing it at time of translation to C.

#ifdefs

Last updated 1 year ago

NetBSD Source Changes · @netbsdsrc
23 followers · 3758 posts · Server mstdn.social
JdeBP · @JdeBP
35 followers · 249 posts · Server tty0.social

@brynet @benjamineskola @judfilm @brightside

Of course it's going to have . 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 __Linux__. Indeed, that's the same level of analysis as the OpenDoas author wholesale deleting all the code that's behind __OpenBSD__, the exact commit for which is earlier in this very thread.

#ifdefs #ifdef #openbsd #doas

Last updated 1 year ago

Simon Frankau · @sgf
138 followers · 601 posts · Server mastodon.xyz

@mcc Most of what I do isn't heavily platform-y, but github.com/emilk/egui/tree/0.1 just kinda made sense to me, although they've restructured since - 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 . It's left me wanting systems with (excessively?) clear separation/layers.

#ifdefs

Last updated 2 years ago

Len Frankel · @Hyperlynx
44 followers · 391 posts · Server aus.social

@fraggle 😱 they're not even internally consistent. Sometimes they've indented their horrible , sometimes they haven't.

#ifdefs

Last updated 2 years ago

John Kaniarz · @jkaniarz
21 followers · 247 posts · Server mastodon.gamedev.place

@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 , but it works.

#ifdefs

Last updated 2 years ago

Noam Preil :plan9: · @pixelherodev
273 followers · 2800 posts · Server fosstodon.org

The problem is that almost nobody does this.

Most C written in this millenia is either a pile of 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.

#ifdefs

Last updated 2 years ago

Jonathan Wight · @schwa
1773 followers · 415 posts · Server mastodon.social

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 )

And I am pleasantly surprised how well it is working.

SwiftUI truly is something special.

#ifdefs

Last updated 2 years ago

Jonathan Wight · @schwa
2557 followers · 1972 posts · Server mastodon.social

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 )

And I am pleasantly surprised how well it is working.

SwiftUI truly is something special.

#ifdefs

Last updated 2 years ago

postmodern · @postmodern
669 followers · 504 posts · Server ruby.social

@eregon github.com/lattera/glibc/blob/
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 for SEEK_DATA in io.c.
github.com/ruby/ruby/blob/bbc4

#ifdefs

Last updated 2 years ago

Matthew Garrett · @mjg59
1774 followers · 24 posts · Server mastodon.social

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 are wrong as a result

#ifdefs

Last updated 2 years ago

Retrograde · @Retrograde
453 followers · 865 posts · Server oldbytes.space

Sick And Tired of opening "cross platform" C++ files to find the 'abstraction' level to be 🙄​

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.

#ifdefs

Last updated 4 years ago

· @murks
231 followers · 4064 posts · Server social.tchncs.de

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 than anything.

#ifdefs

Last updated 4 years ago

· @murks
234 followers · 4156 posts · Server social.tchncs.de

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 than anything.

#ifdefs

Last updated 4 years ago

antekone · @antekone
139 followers · 304 posts · Server mstdn.io

@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:

opensource.apple.com/release/m

There is only 'xnu' package, and inside the sources are numerous to check if the kernel is being compiled for iOS. So isn't this kernel source the same for macOS and iOS?

#ifdefs

Last updated 6 years ago

MightyBigCar · @MightyBigCar
215 followers · 4459 posts · Server octodon.social

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 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.

#ifdefs

Last updated 7 years ago

Hisham · @hisham_hm
1197 followers · 4364 posts · Server mastodon.social

@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 "" and make everything optional (or move to a plugin architecture). It's more code maintenance burden, but it shifts the userbase management burden...

#ifdefs

Last updated 7 years ago

antekone · @antekone
139 followers · 304 posts · Server mstdn.io

I can't wait for module support in C++. If there's a chance to reduce the usage of C++ preprocessor ( and ), I'm voting to have it :)

#defines #ifdefs

Last updated 8 years ago