Advertisement · 728 × 90
#
Hashtag
#UNDEF
Advertisement · 728 × 90

#undef.

1 0 0 0

ly available. That is why you can use enum, it is a constant expression and it is properly scoped:
```
{
enum { N = 10 };
// N = 10
}
// N undefined
```
(#define would need a separate #undef at the end of scope )

But you are using C++ so I would recommend constexpr.
(I was joking w/ enum)

1 0 1 0

The more I program in C, the more I appreciate how powerful macros can be. You don't really need anonymous functions if you can just #define one inline before you need it, and then #undef it afterwards. It looks like you're calling a function but it just expands out to your code in the end.

0 0 0 0

#ifndef _SHH_AVAILABILITY_H
#define _SHH_AVAILABILITY_H

#include <Availability.h>

#undef API_UNAVAILABLE
#define API_UNAVAILABLE(...)
#undef API_PROHIBITED
#define API_PROHIBITED(...)
#undef __API_UNAVAILABLE
#define __API_UNAVAILABLE(...)

#endif

clang -include ShhhAvailability.h …

2 0 0 0

Sometimes I like to write an #undef for a macro that was never defined in the first place, usually in the middle of a file. Keeps the maintainers on their toes

75 2 3 0

Of course but only if you have access to that class, if you're using a library you're done. Althought I've heard people use

#define private public
#include "Stuff.h"
#undef private

But I get what you mean

1 0 0 0
Post image

#internationaldayofdemocracy, Sept 15

This illustration emphasizes that #democracy is not just about voting, but about inclusive #participation, protecting rights, ensuring justice, and maintaining institutions that serve all #people equally...

@un.org #unitednations #un #undef #vote #democracyday

0 0 0 0
Post image

#internationaldayofdemocracy, September 15

#democracy

=From Greek words, "demos", (people), "kratos" (power)

=draws its strength from people: their voices, choices, and participation in shaping their societies...

#unitednationsdemocracyfund @ungeneva.bsky.social @un.org #unitednations #un #undef

1 0 0 0

#undef assert
#define assert(...)

3 0 0 0

For now I'm getting around this with

#undef CFG_TUSB_OS
#define CFG_TUSB_OS OPT_OS_NONE

in tusb_config.h, which disables the spinlocks in tud_task() on RP2350 but lets atomics remain fully functional. Not sure what a proper upstream fix would look like which handles all multicore TinyUSB use cases

1 0 0 0

I forgot about those windows ones. I definitely have some #undef min #undef max in my project. so annoying

0 0 0 0

#ifndef USE_SCRIPT
#define USE_SCRIPT
#endif
#ifndef USE_SML_M
#define USE_SML_M
#endif
#ifdef USE_RULES
#undef USE_RULES
#endif

#ifndef USE_SCRIPT_JSON_EXPORT
#define USE_SCRIPT_JSON_EXPORT
#endif
#ifndef USE_SCRIPT_WEB_DISPLAY
#define USE_SCRIPT_WEB_DISPLAY
#endif

0 0 0 0

#include <stdio.h>

#define white Black // Program white = Black

typedef enum { Black, White } Color; // Statement: black is Black

const char* argument = "white is the Solution"; // Argument: white is the Solution

#undef Black
#define Black white // Re-Definition: Black is white

/1

3 1 1 0

// Don't alias here
#if defined( CPortal_Player )
#undef CPortal_Player
#endif

0 0 1 0

#undef, undef them all!!

0 0 0 0
Applying for an UNDEF project grant and selection process | Democracy Fund UNDEF accepts on-line proposals during an annual window, which will open from the first of February 2025 to 28th February 2025. There will be no extension to the deadline (11:59pm Eastern Time on 28th...

O Fundo para a Democracia da ONU (UNDEF) abriu inscrições (até 28/02) p/ a 19ª rodada de financiamento de projetos de fortalecimento da democracia. Serão aceitas propostas de até US$ 200 mil por org. da soc. civil para projetos de 2 anos de duração. #UNDEF #democracia #ONU
www.un.org/democracyfun...

0 0 0 0

The Fourth Hard Problem in Computer Science:

Whether to use

#define FOO 0

or

/* #undef FOO */

or

#undef FOO

or even

/* #define FOO */

for things that aren't present/enabled/turned on in a config.h. FOO can start with HAVE_ or not.

0 1 0 0

Nice. If there's text there that's supposed to represent "generics without C++", I'm not seeing it, and I *have* seen this in production code.

Also:
#define protected public
#include "thing.hxx"
#undef protected

2 0 1 0

#ifdef XXX みたいなので色々切り替えてるコードの途中で #undef XXXをぶちこむの邪悪すぎでは?

4 0 0 0

#include <stdio.h>
#include_next <twitter.h>
#ifdef __OBJC__
#import <objc/objc.h>
#endif
#pragma once
#ifndef Auschwitz
#define Auschwitz "Nazi concentration camp"
#endif
#if 1
#warning "foo"
#elif (1 != 1)
#error "bar"
#else
#endif
#line 1
#undef Auschwitz
#ident "ab"
#sccs "c"

0 0 1 0

#undef NO_OBSOLETE_FUNCS
Ahem, IDA's ua_ana0() would like to have a word with you :) https://x.com/d_olex/status/751294499465428992

0 0 0 0