Files
STM32F4-Base/App/iec60870/common/IEC60870_StaticAssert.h
T
wandering1 c0cef2fca0 refactor(app): 去掉 App/protocol 层,104 迁入 App/iec60870/104_port
IEC 60870 是标准族(含 104/101),原 App/protocol/ 把它拆成
iec60870/(vendor 核心)+ iec104/(我方适配)两棵同级树,多一层且
看不出「104 只维护一个」。现按标准族收口:

  App/protocol/iec60870        -> App/iec60870
  App/protocol/iec104          -> App/iec60870/104_port
  App/protocol/{README.md,.gitkeep}  删除
  App/protocol/iec104/iec104_asdu.h  删除(零 include / 零注册的孤儿)

vendor 子树(104/ common/ examples/)逐字节未改:91 个 R100 重命名、
git diff --cached -M 后 0 insertions / 0 deletions,另按字节直比 89/89
一致;UPSTREAM.sha256 差异集仍等于既有 17 项受控差异,非篡改。
适配层只改注释里的路径字样,无逻辑行。

门禁配套:
- coding-standard 的 exclude 不能写祖先 App/iec60870/——rename_ref 机械
  改出的祖先形态会把 2,191 行适配层一起豁免掉。改为三条精确前缀
  common/ 104/ examples/,适配层 11/11 回到受检;vendor 直调脚本仍报
  88 处违规而钩子 Skipped,证明确实由 exclude 生效而非空跑。
- check_registration 的 KNOWN_GAPS 键与理由文本同步到新路径。

验证:Keil 0 errors 0 warnings(Code=367464 RO-data=48492
RW-data=2288 ZI-data=173544),构建日志与 .d 依赖证明 5 个适配 .o
真被编入;模拟器 0 警告并跑通 iec104-tcp 13/13 真实 TCP 回环;
pre-commit 25 Passed / 0 Failed;doc-links 30 处问题全在
IEC60870-Slave/ 供应商快照,我方文档零新增。

顺带删掉仓根误入库且零引用的 _all_hook.txt 与 _scope.txt。
2026-11-18 14:15:10 +08:00

14 lines
606 B
C

/* Compile-time assertions for C99 targets; no runtime storage or code. */
#ifndef IEC60870_STATIC_ASSERT_H
#define IEC60870_STATIC_ASSERT_H
#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L)
#define IEC60870_ASSERT_JOIN_INNER(a, b) a##b
#define IEC60870_ASSERT_JOIN(a, b) IEC60870_ASSERT_JOIN_INNER(a, b)
/* A false constant expression produces an invalid negative array bound. */
#define _Static_assert(condition, message) \
typedef char IEC60870_ASSERT_JOIN(iec60870_static_assert_, __LINE__)[(condition) ? 1 : -1]
#endif
#endif /* IEC60870_STATIC_ASSERT_H */