Fix triangle.h conflict with OpenFOAM

- Rename triangle.h to cork_triangle.h to avoid conflict with OpenFOAM's triangle.H
- Add header guards (#ifndef CORK_TRIANGLE_H) to prevent multiple inclusion
- Add REAL type definition to prevent compilation errors
- Update all references from triangle.h to cork_triangle.h in:
  - src/isct/triangle.c
  - src/mesh/mesh.isct.tpp

This resolves the triangulateio struct redefinition error when building
with OpenFOAM integration.
This commit is contained in:
Zhengshou Lai
2025-09-24 10:04:40 +08:00
parent c2a3f81635
commit a799424a53
3 changed files with 14 additions and 2 deletions
@@ -1,3 +1,14 @@
#ifndef CORK_TRIANGLE_H
#define CORK_TRIANGLE_H
/* Define REAL type */
#ifndef SINGLE
#define REAL double
#else
#define REAL float
#endif
/*****************************************************************************/
/* */
/* (triangle.h) */
@@ -287,3 +298,4 @@ void trifree(void *memptr);
/*void triangulate();
void trifree();*/
/*#endif*/ /* not ANSI_DECLARATORS */
#endif /* CORK_TRIANGLE_H */
+1 -1
View File
@@ -354,7 +354,7 @@
#include <fpu_control.h>
#endif /* LINUX */
#ifdef TRILIBRARY
#include "triangle.h"
#include "cork_triangle.h"
#endif /* TRILIBRARY */
/* A few forward declarations. */
+1 -1
View File
@@ -35,7 +35,7 @@
#define REAL double
extern "C" {
#include "triangle.h"
#include "cork_triangle.h"
}
struct GenericVertType;