Skip to content

Commit

Permalink
Merge pull request #872 from SRGSSR/libextobjc-conflict-fix
Browse files Browse the repository at this point in the history
Fix for compilation issue when Mantle 2.1.5 is integrated alongside libextobjc with CocoaPods
  • Loading branch information
robb authored Oct 17, 2020
2 parents d123b3a + dd3ca5c commit eb4ad29
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 86 deletions.
120 changes: 60 additions & 60 deletions Mantle.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Mantle/MTLJSONAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#import "NSDictionary+MTLJSONKeyPath.h"

#import "EXTRuntimeExtensions.h"
#import "EXTScope.h"
#import "MTLEXTRuntimeExtensions.h"
#import "MTLEXTScope.h"
#import "MTLJSONAdapter.h"
#import "MTLModel.h"
#import "MTLTransformerErrorHandling.h"
Expand Down
4 changes: 2 additions & 2 deletions Mantle/MTLModel+NSCoding.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright (c) 2013 GitHub. All rights reserved.
//

#import "EXTRuntimeExtensions.h"
#import "EXTScope.h"
#import "MTLEXTRuntimeExtensions.h"
#import "MTLEXTScope.h"
#import "MTLModel+NSCoding.h"
#import "MTLReflection.h"

Expand Down
6 changes: 3 additions & 3 deletions Mantle/MTLModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// Copyright (c) 2012 GitHub. All rights reserved.
//

#import "EXTRuntimeExtensions.h"
#import "EXTScope.h"
#import "NSError+MTLModelException.h"
#import "MTLEXTRuntimeExtensions.h"
#import "MTLEXTScope.h"
#import "MTLModel.h"
#import "MTLReflection.h"
#import "NSError+MTLModelException.h"
#import <objc/runtime.h>

// Used to cache the reflection performed in +propertyKeys.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// EXTRuntimeExtensions.m
// MTLEXTRuntimeExtensions.m
// extobjc
//
// Created by Justin Spahr-Summers on 2011-03-05.
// Copyright (C) 2012 Justin Spahr-Summers.
// Released under the MIT license.
//

#import "EXTRuntimeExtensions.h"
#import "MTLEXTRuntimeExtensions.h"
#import <ctype.h>
#import <libkern/OSAtomic.h>
#import <objc/message.h>
Expand Down Expand Up @@ -41,10 +41,10 @@
//
// this does NOT refer to a special protocol having been injected already
BOOL ready;
} EXTSpecialProtocol;
} MTLSpecialProtocol;

// the full list of special protocols (an array of EXTSpecialProtocol structs)
static EXTSpecialProtocol * restrict specialProtocols = NULL;
// the full list of special protocols (an array of MTLSpecialProtocol structs)
static MTLSpecialProtocol * restrict specialProtocols = NULL;

// the number of special protocols stored in the array
static size_t specialProtocolCount = 0;
Expand All @@ -54,7 +54,7 @@
// generally going to be a power-of-two
static size_t specialProtocolCapacity = 0;

// the number of EXTSpecialProtocols which have been marked as ready for
// the number of MTLSpecialProtocols which have been marked as ready for
// injection (though not necessary injected)
//
// in other words, the total count which have 'ready' set to YES
Expand All @@ -81,16 +81,16 @@ static void mtl_injectSpecialProtocols (void) {
* a special protocol conforms to another special protocol, the former
* will be prioritized above the latter.
*/
qsort_b(specialProtocols, specialProtocolCount, sizeof(EXTSpecialProtocol), ^(const void *a, const void *b){
qsort_b(specialProtocols, specialProtocolCount, sizeof(MTLSpecialProtocol), ^(const void *a, const void *b){
// if the pointers are equal, it must be the same protocol
if (a == b)
return 0;

const EXTSpecialProtocol *protoA = a;
const EXTSpecialProtocol *protoB = b;
const MTLSpecialProtocol *protoA = a;
const MTLSpecialProtocol *protoB = b;

// A higher return value here means a higher priority
int (^protocolInjectionPriority)(const EXTSpecialProtocol *) = ^(const EXTSpecialProtocol *specialProtocol){
int (^protocolInjectionPriority)(const MTLSpecialProtocol *) = ^(const MTLSpecialProtocol *specialProtocol){
int runningTotal = 0;

for (size_t i = 0;i < specialProtocolCount;++i) {
Expand Down Expand Up @@ -799,9 +799,9 @@ BOOL mtl_loadSpecialProtocol (Protocol *protocol, void (^injectionBehavior)(Clas
#ifndef __clang_analyzer__
mtl_specialProtocolInjectionBlock copiedBlock = [injectionBehavior copy];

// construct a new EXTSpecialProtocol structure and add it to the first
// construct a new MTLSpecialProtocol structure and add it to the first
// empty space in the array
specialProtocols[specialProtocolCount] = (EXTSpecialProtocol){
specialProtocols[specialProtocolCount] = (MTLSpecialProtocol){
.protocol = protocol,
.injectionBlock = (__bridge_retained void *)copiedBlock,
.ready = NO
Expand Down
4 changes: 2 additions & 2 deletions Mantle/extobjc/EXTScope.m → Mantle/extobjc/MTLEXTScope.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// EXTScope.m
// MTLEXTScope.m
// extobjc
//
// Created by Justin Spahr-Summers on 2011-05-04.
// Copyright (C) 2012 Justin Spahr-Summers.
// Released under the MIT license.
//

#import "EXTScope.h"
#import "MTLEXTScope.h"

void mtl_executeCleanupBlock (__strong mtl_cleanupBlock_t *block) {
(*block)();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// EXTKeyPathCoding.h
// MTLEXTKeyPathCoding.h
// extobjc
//
// Created by Justin Spahr-Summers on 19.06.12.
Expand All @@ -8,7 +8,7 @@
//

#import <Foundation/Foundation.h>
#import "metamacros.h"
#import "MTLMetamacros.h"

/**
* \@keypath allows compile-time verification of key paths. Given a real object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// EXTRuntimeExtensions.h
// MTLEXTRuntimeExtensions.h
// extobjc
//
// Created by Justin Spahr-Summers on 2011-03-05.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// EXTScope.h
// MTLEXTScope.h
// extobjc
//
// Created by Justin Spahr-Summers on 2011-05-04.
// Copyright (C) 2012 Justin Spahr-Summers.
// Released under the MIT license.
//

#import "metamacros.h"
#import "MTLMetamacros.h"

/**
* \@onExit defines some code to be executed when the current scope exits. The
Expand Down
File renamed without changes.

0 comments on commit eb4ad29

Please sign in to comment.