Just about to tidy this up. As you can see, I've added the `#ifndef` at the top.
Thing is, "epoccons.h" doesn't exist in any version of the SDK that I have.
However... It is in an archive of Psion include files given to me by a former Psion dev, along with some other files that I don't think are in the SDK.
I don't know if these files have ever been made public before.
Should I include them in my SDK?
So, it seems that "NSM" wrote the PLIB headers. They're checking for P_whatever_H before including the header, rather than doing it within the header itself.
This only seems to happen in PLIB header files - other headers written by other people do the check inside the header, which to me is the right way to do it.
So, do I only add the `#ifndef` clauses to each PLIB header file, or do I also strip out the unnecessary extra checks? If it was my code, I'd bin them.
After a day of feeling meh, I've cheered up because...
I FOUND A BUG IN THE #PSION SIBO C SDK!
The project I was compiling built fine with SDK 2.00 but complained about macros already being defined when compiling with 2.20.
Something's changed between the two versions, so p_file.h is now being included when it wasn't before. But this project already included it. And p_file.h doesn't have an `#ifndef P_FILE_H` at the top!
It's a teeny bug, but it's made me happy to find it.
#retrocomputing #ifndef #psion
arg
two libraries I'm using are colliding on IFDEF names
because both have #ifndef KEY_H include barriers around their very generically named key.h files
I found a quick way to find out how well these tools adapt to your code. Open a new hpp file and start writing the header guards.
With Copilot, for VlkImage.hpp, after writing "#ifndef __" I get an autocomplete of "__VK_IMAGE_HPP__". This is not valid.
When I open one or two other headers that have a guard pattern I use, the suggestion becomes "__VLKIMAGE_HPP__" as it should.
Tabnine was not able to adapt to this and just presented random completions.
I rebuild Mesa with assertions enabled and rerun the unit test... and it passes. Huh?
I rebuild without assertions, assuming I made some kind of mistake. Unit test fails again.
I confirm that the allocations are properly aligned when Mesa is built with assertions and unaligned when built without assertions. So I'm not going crazy, but WTF?
Then I spot this in the definition of the `gc_block_header` struct (which `gc_alloc_size` allocates):
> #ifndef NDEBUG
> unsigned canary;
> #endif
Oh.
Thanks to the excellent search skills of @galaxis, I now have Elvis 1.8p4 without the #EPOC16 patch. Comparing the two, the changes are:
1. EPOC16 specifics and workarounds, as expected. (`#ifndef EPOC`, etc.)
2. All the man pages have been removed.
3. A new "libc" folder filled with wrappers for Psion's plib.
4. Most strings have been replaced with references to a resource file. Why? The EPOC16 version could be regionalised!
5. Edited files have been changed from UNIX to DOS linebreaks.
@gadgetoid Ouch, more "fun"... Can't really check that the builds actually work in CI I guess.
(Hmm, probably could if you had an accurate enough emulator, but...)
BTW, the race condition might be qstr related... maybe stick a #ifndef NO_QSTR around the pio includes. (Ran into this with 32blit-micropython a lot)
@zoerhoff @amszmidt on this note, change m 's line 90 <<< to < for /bin/sh (as on openbsd current) the other change I needed to make was to add a missing function prototype to usim's tv.c . I just wedged the tv_write() function prototype at the top of the file rather than putting it in the header. After which usim appeared to build happily. I didn't think about how it relates to the tv.h #IFNDEF USIM_TV_H .. extern void tv_write(uint32_t, uint32_t); .. #endif prototype. I should think more ;p
# 現在の技術的案件 (続き)
例えば、環境変数 VTE_CJK_WIDTH を用いて EAW Ambiguous 文字幅の挙動を変える場合は、以下のコードを追加すればよい。
GtkWidget *vte = vte_terminal_new();
...
#ifndef NO_UTF8_CJK
char *vte_cjk_width = NULL;
vte_cjk_width = g_getenv("VTE_CJK_WIDTH");
if ((vte_cjk_width != NULL) && (strncmp((const char *)vte_cjk_width, "1", (size_t)1) == 0)) {
if (vte_terminal_get_cjk_ambiguous_width(VTE_TERMINAL(vte)) != 2) {
vte_terminal_set_cjk_ambiguous_width(VTE_TERMINAL(vte), 2);
}
}
#endif
@alderwick
@neauoire Hmm: I see that #9front doesn't support "#if" directives if that error message means what I think it does. If it supports "#ifndef" instead, I suggest wrapping the Windows section with that to keep the 9front compiler out... (Sorry)
@mynameistrez totally! like #ifndef _DEBUG perhaps to make it go away in release automatically. That's good stuff.
@mum /*
Copyright (c) 2009-2016 Johan Lindh <johan@linkdata.se>
This file is part of LCDHost.
LCDHost is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LCDHost is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LCDHost. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LH_QTMEMORY_H
#define LH_QTMEMORY_H
#include "../LH_QtInstance.h"
#include <QGraphicsItem>
#include <QGraphicsPathItem>
#include <QPainterPath>
#include <QString>
#include <QtGlobal>
class LH_QtMemory : public QObject, public LH_QtInstance
{
Q_OBJECT
protected:
int allocated_;
int allocated_cur_;
int allocated_min_;
int allocated_max_;
QPainterPath *path_;
qreal memory_step_;
public:
LH_QtMemory();
~LH_QtMemory();
const char *userInit();
void userTerm();
int notify(int n, void *p);
QImage *render_qimage( int w, int h );
void render_qpainter(QPainter *painter, int w, int h);
public slots:
void memCheck();
};
#endif // LH_QTMEMORY_H
#ifndef #define #include #endif
@NYAGO /**
* @author Ayoub Chouak (a.chouak@protonmail.com)
* @file utest.h
* @brief Utilities macros and functions used in testing
*/
#ifndef YAMLIB_UTEST_H
#define YAMLIB_UTEST_H
#include <stdio.h>
#include <stdbool.h>
#define TEST_ASSERT(c, s) \
do { \
if (!(c)) { \
printf("[F] %s\n", s); \
return false; \
} \
} while (0)
#define TES
just got to the bottom of a VERY puzzling bug which it transpired to be because i had, presumably whilst on acid or shrooms or very drunk or something, wrapped the conditional part of an if() / else block in an #ifndef NDEBUG, so that if NDEBUG *was* defined, i.e., in a release build, only the 'else' block was compiled
i can only imagine i’d actually intended to do the opposite, and make the 'else' part only be compiled when debugging is turned on