Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Make runtime issues to compile time errors #52

Closed
rainman110 opened this issue Nov 3, 2019 · 1 comment
Closed

Improvement: Make runtime issues to compile time errors #52

rainman110 opened this issue Nov 3, 2019 · 1 comment

Comments

@rainman110
Copy link
Contributor

I thought about this a while. I'd really like to make sure, that the issues you had memory wise should be catched already at compile time. I found a very simple solution to it:

In the arguments of the swig headers, we don't use opencascade::handle. Instead we use a new unknown type e.g. OccHandle_XXX. This type is only known, if it was defined in the other module.

A concrete example:

BRepBuilderAPI.i:

import Geom.i

BRepBuilderAPI_MakeEdge(OccHandle_Geom_Curve curve);

Geom.i

%wrap_handle(Geom_Curve)

#define OccHandle_Geom_Curve opencascade::handle<Geom_Curve>

class Geom_Curve
{
...
};

I tried this just now, and it seems to be working. When you don't include Geom.i, you'll get a compiler error.

@rainman110
Copy link
Contributor Author

Using this technique, I already found many missing imports. I'll try to make compiling successful, then I send you a list of missing imports.

I also found some cyclic imports, e.g. in standard.i. we probably need a better way to determine module dependencies.

@tpaviot tpaviot closed this as completed Jul 30, 2023
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

No branches or pull requests

2 participants