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

[Bug]: Importing a module with a Module-Swift.h fails to compile by default in C++ #749

Open
leptos-null opened this issue Jul 9, 2023 · 0 comments

Comments

@leptos-null
Copy link
Contributor

What are the steps to reproduce this issue?

Minimum project to reproduce:

  • Makefile

    TARGET := iphone:clang:latest:14.0
    THEOS_PACKAGE_SCHEME := rootless
    
    include $(THEOS)/makefiles/common.mk
    
    LIBRARY_NAME = TestIssue
    
    TestIssue_FILES = TestIssue.mm
    TestIssue_CFLAGS = -fobjc-arc
    TestIssue_EXTRA_FRAMEWORKS = Cephei
    
    include $(THEOS_MAKE_PATH)/library.mk
  • TestIssue.mm:

    #import <Cephei/Cephei.h>
  1. Run make

What happens?

The project fails to compile.

What were you expecting to happen?

The project to compile without warnings or errors.

Perhaps Theos can select a std version that is high enough to handle the code in these headers.

Paste any relevant logs, error output, etc.

> Making all for library TestIssue…
==> Compiling TestIssue.mm (arm64)…
While building module 'Cephei' imported from TestIssue.mm:1:
In file included from <module-includes>:2:
${THEOS}/vendor/lib/iphone/rootless/Cephei.framework/Headers/Cephei-Swift.h:221:13: error: alias declarations are a C++11 extension [-Werror,-Wc++11-extensions]
using Int = ptrdiff_t;
            ^
${THEOS}/vendor/lib/iphone/rootless/Cephei.framework/Headers/Cephei-Swift.h:222:14: error: alias declarations are a C++11 extension [-Werror,-Wc++11-extensions]
using UInt = size_t;
             ^

Additional context

Settings TestIssue_CCFLAGS = -std=c++11 results in the project compiling without warnings or errors.

The lines in question are
https://github.com/theos/lib/blob/a27acf4/iphone/rootless/Cephei.framework/Headers/Cephei-Swift.h#L217-L225

What OS are you seeing the problem on?

macOS

What OS version does it have installed?

macOS 13.4.1

What toolchain and version are you using?

Xcode 14.3

Which SDK version are you using?

iOS 16.4

What OS is your client device running?

iOS

What OS version does it have installed?

N/A

Which device model is it?

N/A

Which jailbreak is it using (if relevant)?

N/A

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

1 participant