develooper Front page | perl.perl5.porters | Postings from April 2017

Multiple inclusion tricks (Was: CORE/util.h breaks if multiplyincluded (patch))

Thread Next
From:
ilmari
Date:
April 10, 2017 14:34
Subject:
Multiple inclusion tricks (Was: CORE/util.h breaks if multiplyincluded (patch))
Message ID:
d8ja87os55n.fsf_-_@dalvik.ping.uio.no
Leon Timmermans <fawaka@gmail.com> writes:

> On Mon, Apr 10, 2017 at 4:00 PM, James Schneider <james.schneider@db.com> wrote:
>> From: karl williamson via RT [mailto:perlbug-followup@perl.org]
>> Sent: Saturday, April 08, 2017 12:47 PM
>>
>> Kind of off topic but ... any idea what those "tricks" were?

Perlbug Cc: and ticked ID removed, since it's not directly relevant any
more.

> #define FOO something
> #include "foo.h"
> #undef FOO
>
> #define FOO something_else
> #include "foo.h"
> #undef FOO

For example:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/lib/simplehash.h;hb=HEAD

- ilmari
-- 
- Twitter seems more influential [than blogs] in the 'gets reported in
  the mainstream press' sense at least.               - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
  to a mainstream media article.                      - Calle Dybedahl

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About