~mirabilos/mksh/MAIN

« back to all changes in this revision

Viewing changes to mbsdcc.h

  • Committer: tg
  • Date: 2023-09-17 02:00:47 UTC
  • Revision ID: tg-20230917020047-wsjxfp3e7zpcp52v
quell MSVC struct padding warnings for CTAs

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
 
7
7
#ifndef SYSKERN_MBSDCC_H
8
 
#define SYSKERN_MBSDCC_H "$MirOS: src/bin/mksh/mbsdcc.h,v 1.3 2023/09/17 01:54:04 tg Exp $"
 
8
#define SYSKERN_MBSDCC_H "$MirOS: src/bin/mksh/mbsdcc.h,v 1.4 2023/09/17 02:00:47 tg Exp $"
9
9
 
10
10
#if !defined(_KERNEL) && !defined(_STANDALONE)
11
11
#include <stddef.h>
80
80
#define mbccCTA(fldn,cond)      __extension__ _Static_assert(cond, mbccS(fldn))
81
81
#endif
82
82
#ifndef mbccCTA
83
 
/* single assertion for macros (prefix fldn suitably and parenthesise cond) */
84
 
#define mbccCTA(fldn,cond)      unsigned int fldn:(cond ? 1 : -1)
 
83
/* single assertion for macros (needs fldn prefixed, cond parenthesised) */
 
84
#define mbccCTA(fldn,cond)      unsigned char fldn:(cond ? 1 : -1)
85
85
/* begin/end assertion block */
86
86
#define mbCTA_BEG(name)         struct ctassert_ ## name {              \
87
87
                                        char ctabeg /* plus user semicolon */