home.social

#defines — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #defines, aggregated by home.social.

fetched live
  1. Our next #JCON2026 session is live: 'The Reputation Formula: #Turbocharge Your #Developer Career' with Bruno Souza

    #Reputation is what people believe about you. And it is your reputation that #defines the projects you work at, …

    Grab your coffee and hit play: youtu.be/q9CEpXgUjvY

  2. @kevingranade i skipped the windows override injection stuff and just built the files alongside and used #defines to call the mi_malloc instead, worked great first try!

  3. @tedmielczarek Unfortunately, Windows.h #defines "near" and "far", and X11.h #defines "Success" and "Status", and both these files will eventually get indirectly included into every file.

  4. why did i think that i just needed need a couple of #defines in order to use the #RStats Matrix package's #cholmod headers github.com/cran/Matrix/blob/ma (and Matrix.so) to compile the bcftools PGS plugin github.com/freeseek/score/blob ? It worked on gcc, but clang (with defaults) was much less forgiving :D
    #RStats gurus : is their a #RStats package that just provides cholmod and nothing else ?

  5. @ljs @amonakov @pkhuong @thesamesam OK but let's go back to the more verbose way.

    #define __alloc_pages_node(...) alloc_hooks(__alloc_pages_node(__VA_ARGS__))
    #define __alloc_pages_node_noprof (__alloc_pages_node)

    Would that work then? Yes it's more (up to twice) #defines than we have now, but it wouldn't require us to rename the underlying functions to _noprof (and having see those _noprof symbols in perf, backtraces etc.).

  6. @celestia

    "Hey Bjarne, why don't we add this object oriented stuff to C? Classes are basically structs, right?

    "Well, the core of object orientation is the use of immutable messages, I don't see how that would work in C."

    "Just ignore that part then. Two or three #defines and we should be done."

    "I guess we need another bottle of wine."

  7. @ulexus In a strongly typed language a good IDE can do a great job on syntax - especially in a large project. But on a small C project with any significant #defines - it is pretty much a lost cause IMHO. Perhaps I haven't invested enough in configuration.

  8. @peteri That sounds like a strong possibility. All of the vga code is isolated in the vgadisplay.c file, and the resolution/mode is currently hardcoded in the #defines at the top of the file.

  9. I'm reminded of years ago when I discovered that the Illumos driver for 10G-T Intel Ethernet chipsets had a 'wait' operation that was implemented with a busy-wait, and used it for multi-millisecond waits through a chain of #defines

    (The original kernel busy-wait was intended for microsecond waits, then got resused by the driver because hey, it was there, scaling by 1000 is fine, right?)

    In re: mastodon.social/@whitequark/11

  10. A fabulous amount of source notes pop up

    {quote

    scsi_all.h started out life as a work by Julian Elischer to add SCSI
    support to CMU Mach 2.5. It was 373 lines. Julian ported this to 386BSD,
    included in the 386BSD patch kit and incorported into FreeBSD at its
    creation. Justin used this file when writing CAM, and imported it with
    the initial CAM import, but only 30% (100 lines) of the original
    remained. Justin moved from bitfields to bytes in structures, dropped
    the complex unions, and renamed many structures to have their length
    appended. Only about 30 structure names and about 40 #defines remained
    from the original. The define names were taken directly from the SCSI
    standard with spaces replaced by '_', so had no creativity. Apart from
    the license comment, there were no comments retained (all the comments
    in the CAM import were written by Justin and Ken). Even at that time,
    Justin and Ken could have put their copyrights and names and moved to an
    acknowledgement of Julian.

    In the almost 30 years since that original import, this file has grown
    to 4500 lines. Kenneth Merry, Alexander Motin and Justin Gibbs write
    85% of the file's lines, if mechanical commits are omitted. Other
    contributors contributed less than %5 each of the file.

    Replace the original license (which lacked a copyright even and has been
    criticized as ambiguous) with FreeBSD's standard 2-clause license. Add
    copyrights for Justin, Ken and Alexander, with the date ranges they
    contributed to the file. Add a note about the origin of the file to
    acknowledge Julian's original work upon which all this was built, though
    it's become a ship of Theseus in the mean time, built and rebuild many
    times.

    On an absolute scale, there's less than 1% of the current file with
    lines from the original, and those are named after the names in the SCSI
    standards and likely wouldn't qualify for copyright protection.

    Sponsored by: Netflix
    Reviewed by: mav, ken
    Differential Revision: reviews.freebsd.org/D49016

    End Quote}
    ^Z

    How wonderful to have learned this now

    #bash #csh #ksh #sh #freeBSD #SCSI #bhyve #jails #ZFS #programming #POSIX

    codeberg.org/FreeBSD/freebsd-s

  11. Baking does lots of stuff - light maps, visibility queries, SH probes, etc.

    This built system runs on top of a very simple distributed processing system - you just tell the system "run this linux command somewhere" and it just does it. No incredibuild here.

    They use ubershaders with #defines for each feature.

    They wrote their own GUI shader editor for artists. Programmers would "export" feature flags and settings, and an artist could play around with them. They hooked it up to Maya.

    4/10

  12. "But but .. main.h will contain the for all the named pins"

    then use _ and no spaces @_@ it's not that hard.

    stackoverflow.com/questions/71

  13. @samloonie I mean, it will flash successfully without even touching the button, and the hash/CRC claims to be correct. But there must be a half-dozen or more partitioning options in the IDE, and various other IDE tools options that appear to duplicate #defines in the code. But I'll look at what's on there now and see if anything is showing up on the serial port finally.

  14. @phil_stevens No OTA, just direct USB to the MD motherboard. There doesn't seem to be any serial anything. I could use a simple test program that is least likely to need trickier configurations, but the SDK is full of Tools settings, and it's not clear to me how these interact with the code's own #defines.

  15. @josch do note that the iso646.h header isn't for adding this functionality. you can add it using simple \#defines if you wanted to, but the iso646 header contains much more than that.

  16. INTERFACE spits out an .H file with the resource IDs and an .RSH file with the OBJECT and OBSPEC data all helpfully in arrays of C structs. the only problem is the output is for Pure C’s TOS lib and not MiNTlib so I need to include a file that converts the #defines first.

    But it means I should be able to whip up a loader that places the OBJECTs in my window’s OBJTREE, converts INTERFACE’s character grid coordinates to pixel grid coordinates, and places the container G_BOX where I want it

  17. GLSL-like swizzling in C++20

    * without #defines
    * using field syntax
    * supporting assignment
    * without UB (I think)

    godbolt.org/z/xY7Pxerez

  18. @Doomed_Daniel By the way, my favorite variant of X macros is to use a separate .inl file that's parameterized and configured by a bracketed set of #defines by the includers. It often lets you get away with much cleaner syntax.

  19. Eclipse Сборка с Помощью ARM GCC Плагинов

    В программировании микроконтроллеров часто используют Eclipse с плагинами. Главным образом от незнания языков скриптов сборки (Make, Cmake, Ninjia и т п). В этом тексте я напишут почему способ сборки из Eclipse c ARM плагинами - это тупиковый путь в разработке больших промышленных командных проектов. И как можно частично компенсировать недостатки Eclipse с плагинами.

    habr.com/ru/articles/794206/

    #eclipse #plugins #mcu #ARM #include #defines #пример_того_что_делать_не_стоит #Eclipse_Embedded_CDT

  20. After a little bit of fiddling around this morning, I've realised that the classes aren't in the order they come in the external files. In fact, I have no idea how they're ordered. I assume it's something to do with dependencies, but I can't see it.

    Like I said, it probably makes no difference - it's just a load of #defines. But I'd like to make it character-perfect at some point.

    I have other things to do today, but if I get a chance this evening I'll try using #ctran to compile something.

  21. @stuartmarks amusingly a few posts before this in my feed was complaints about namespace pollution from the Xlib.h header having for things like “Status” and “None” due to decisions made nearly 40 years ago, when X was just a fun experiment, not core system API.