adamwulf / ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
http://getlooseleaf.com/opensource/
MIT License
254 stars 34 forks source link

ClippingBezier does not build in Xcode 15.0.0 anymore "import of C++ module appears within extern "C" language linkage specification #31

Closed Litome closed 10 months ago

Litome commented 10 months ago

Looks like Apple has changed something in the C / C++ compiler settings when they release xCode 15.0.0 and now, when trying to build our app that uses ClippingBezier as a pod, I see this: Screenshot 2023-09-25 at 14 13 49

Note that it builds fine in Xcode 14.3.1

This seems to be a similar issue as reported here: https://stackoverflow.com/questions/77113501/xcode-15-compile-error-import-of-c-module-zlib-appears-within-extern-c-la

So, applying the suggested fix and modifying file NearestPoint.h from:

#ifndef __ClippingBezier__NearestPoint__
#define __ClippingBezier__NearestPoint__

#if defined __cplusplus
extern "C" {
#endif

#import <CoreGraphics/CoreGraphics.h>
#include <stdio.h>

to:

#ifndef __ClippingBezier__NearestPoint__
#define __ClippingBezier__NearestPoint__

#import <CoreGraphics/CoreGraphics.h>

#if defined __cplusplus
extern "C" {
#endif

#include <stdio.h>

fixes it for me and enables me to compile my app using ClippingBezier with Xcode 15.

I am not sure if this solution is the correct fix but if you're happy with it, I'm happy to create a PR for it.

adamwulf commented 10 months ago

Thanks for tracking that down! that solution looks correct to me, and a PR would be fantastic, thanks 🙏

Litome commented 10 months ago

OK. Pull request is ready here: https://github.com/adamwulf/ClippingBezier/pull/32

Litome commented 10 months ago

@adamwulf What's your timescale for creating a new tagged version?

adamwulf commented 10 months ago

I'll likely be able to get to it this weekend

adamwulf commented 10 months ago

@Litome just pushed up tag 1.2.3