Skip to content

Convert mbmesh module from C to C++ syntax#1

Merged
Lyn-Solarn merged 4 commits into
AI-Prototypefrom
copilot/fix-src-mbmesh-c-to-cpp
Feb 6, 2026
Merged

Convert mbmesh module from C to C++ syntax#1
Lyn-Solarn merged 4 commits into
AI-Prototypefrom
copilot/fix-src-mbmesh-c-to-cpp

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 6, 2026

The mbmesh module was using C syntax with .c file extensions. This converts it to proper C++ while maintaining compatibility with MB-System's C libraries.

Changes

File extensions and build

  • Renamed .c.cpp (4 files)
  • Updated Makefile.am sources list

C++ syntax conversion

  • Replaced C headers with C++ equivalents: stdio.hcstdio, stdlib.hcstdlib, string.hcstring, math.hcmath, time.hctime
  • Replaced NULL with nullptr (11 occurrences)
  • Added extern "C" wrapper in mbmesh.h for MB-System C library linkage

Example change:

// Before
#include <stdio.h>
FILE *fp = fopen(filename, "r");
if (fp == NULL) { ... }

// After  
#include <cstdio>
FILE *fp = fopen(filename, "r");
if (fp == nullptr) { ... }

Memory management remains malloc/free based since the code interfaces with MB-System's C libraries through the extern "C" boundary.

Original prompt

I realized that all the files in src/mbmesh are all in c and not C++. Are you able to fix that?


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 6, 2026 03:22
Co-authored-by: Lyn-Solarn <196580808+Lyn-Solarn@users.noreply.github.com>
Co-authored-by: Lyn-Solarn <196580808+Lyn-Solarn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix source files in mbmesh from C to C++ Convert mbmesh source files from .c to .cpp extensions Feb 6, 2026
Copilot AI requested a review from Lyn-Solarn February 6, 2026 03:25
Co-authored-by: Lyn-Solarn <196580808+Lyn-Solarn@users.noreply.github.com>
Copilot AI changed the title Convert mbmesh source files from .c to .cpp extensions Convert mbmesh module from C to C++ syntax Feb 6, 2026
@Lyn-Solarn Lyn-Solarn marked this pull request as ready for review February 6, 2026 03:36
@Lyn-Solarn Lyn-Solarn merged commit 48b80fd into AI-Prototype Feb 6, 2026
jocy358 added a commit that referenced this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants