From 6de5e1dde74e79d137b1485a72fe1327bb36cd80 Mon Sep 17 00:00:00 2001 From: Le Duc Anh Date: Thu, 2 Oct 2025 15:56:53 +0700 Subject: [PATCH] add convert rules for struct --- .cursor/rules/cpp-convert-rules.mdc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .cursor/rules/cpp-convert-rules.mdc diff --git a/.cursor/rules/cpp-convert-rules.mdc b/.cursor/rules/cpp-convert-rules.mdc new file mode 100644 index 0000000000..2c63fe6fc8 --- /dev/null +++ b/.cursor/rules/cpp-convert-rules.mdc @@ -0,0 +1,13 @@ +--- +alwaysApply: true +--- +When convert cpp to c# +- unsigned long convert to uint +- unsigned char to byte +- task_char to ushort +- Keeps all the naming +- keeps all the original chinese comments. But add a translated English version side by side +- struct has to be public +- struct has to be use [StructLayout(LayoutKind.Sequential, Pack = 1)] +- all field in struct has to be public +- array has to be use [MarshalAs(UnmanagedType.ByValArray, SizeConst = )] to fix the array size