Skip to content

Commit

Permalink
turns out MSVC dislikes offsetof(struct s, label[0])
Browse files Browse the repository at this point in the history
but offsetof(struct s, label) is fine; it considers the latter a
run-time thing, apparently (we test they are identical in mkt-int.sh now)

drop MKSH_BROKEN_OFFSETOF in the same go, because it applied to SCO and
Xenix only, which were probably using MSVC’s antecessor

also allow the mbnil == NULL test on CFrustFrust again as the last changes
seemingly fixed it
  • Loading branch information
mirabilos committed Sep 17, 2023
1 parent ac644ef commit ba4996f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .linked/mbsdcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#ifndef SYSKERN_MBSDCC_H
#define SYSKERN_MBSDCC_H "$MirOS: src/bin/pax/.linked/mbsdcc.h,v 1.2 2023/09/17 00:47:51 tg Exp $"
#define SYSKERN_MBSDCC_H "$MirOS: src/bin/pax/.linked/mbsdcc.h,v 1.3 2023/09/17 01:54:04 tg Exp $"

#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <stddef.h>
Expand Down Expand Up @@ -54,7 +54,7 @@
* int size;
* mbccFAM(char, label); // like char label[…];
* };
* struct s *sp = malloc(offsetof(struct s, label[0]) + labellen);
* struct s *sp = malloc(offsetof(struct s, label) + labellen);
*/

/* field sizeof */
Expand Down

0 comments on commit ba4996f

Please sign in to comment.