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

__private_extern__ deprecated by Xcode 4.6 and preventing a build #62

Closed
farscape13 opened this issue Jan 31, 2013 · 6 comments
Closed

Comments

@farscape13
Copy link

for example in OmniGroup / Frameworks / OmniFoundation / OFStringDecoder.m (and several other classes)

private_extern CFCharacterSetRef OFDeferredDecodingCharacterSet(void);
private_extern unichar OFCharacterForDeferredDecodedByte(unsigned int byte);
private_extern unsigned int OFByteForDeferredDecodedCharacter(unichar uchar);

are now getting rejected by XCode 4.6 with "Use of private_extern on a declaration may not produce external symbol private to the linkage unit and is deprecated"

@fraserhess
Copy link

I ran into this too. Built one day and not the next. Realized I had installed Xcode 4.6 in the interim.

@vincentsaluzzo
Copy link

How we can resolve the problem ?

@vincentsaluzzo
Copy link

XCode told that we should replace this by attribute((visibility("hidden"))) ...

@vincentsaluzzo
Copy link

I have try to replace all this private_extern with attribute((visibility("hidden"))), no error occurs on this but I encount an other:

Tentative array definition assumed to have one element

in OmniUI_prefix.pch file from OmniUITouch target

@tjw
Copy link
Contributor

tjw commented Feb 5, 2013

We've fixed all these issues internally and I'm working on an updated source release. Of course, there are a great many other changes we've made. The two main ones are that we are requiring iOS 6 and are removing iCloud support (but OmniPresence won't be in this next source drop).

For this particular problem, we've added the following macros to OmniBase/macros.h:

/* Replacement for __private_extern__, which is deprecated as of Xcode 4.6 DP2 */
#define OB_HIDDEN __attribute__((visibility("hidden")))

/* The inverse of OB_HIDDEN / __private_extern__, for frameworks which hide symbols by default */
#define OB_VISIBLE __attribute__((visibility("default")))

With these, you can then declare globals variables like:

OB_HIDDEN extern NSString * const OFUserDefaultsRegistrationItemName; // Needed by OFBundleRegistry

and functions like:

NSError *OFXMLCreateError(xmlErrorPtr error) NS_RETURNS_RETAINED OB_HIDDEN;

@tjw
Copy link
Contributor

tjw commented Feb 6, 2013

New source release pushed. Sorry it has been so long … iCloud ate up more time than I thought.

@tjw tjw closed this as completed Feb 6, 2013
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

4 participants