Merge pull request #4893 from yebblies/objcstubs

Fix up objc stubs build
This commit is contained in:
Walter Bright 2015-08-16 02:03:51 -07:00
commit f195beb17e
4 changed files with 32 additions and 66 deletions

View file

@ -1,59 +0,0 @@
// Compiler implementation of the D programming language
// Copyright (c) 1999-2015 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.objc;
import core.stdc.stdio;
import ddmd.dclass, ddmd.dscope, ddmd.dstruct, ddmd.func, ddmd.globals, ddmd.id, ddmd.root.stringtable;
class ObjcSelector
{
public:
extern (C++) static __gshared StringTable stringtable;
extern (C++) static __gshared StringTable vTableDispatchSelectors;
extern (C++) static __gshared int incnum;
const(char)* stringvalue;
size_t stringlen;
size_t paramCount;
static void _init();
// MARK: ObjcSelector
extern (D) this(const(char)* sv, size_t len, size_t pcount);
static ObjcSelector lookup(const(char)* s);
static ObjcSelector lookup(const(char)* s, size_t len, size_t pcount);
static ObjcSelector create(FuncDeclaration fdecl);
}
struct Objc_ClassDeclaration
{
// true if this is an Objective-C class/interface
bool objc;
// MARK: Objc_ClassDeclaration
extern (C++) bool isInterface();
}
struct Objc_FuncDeclaration
{
FuncDeclaration fdecl;
// Objective-C method selector (member function only)
ObjcSelector selector;
}
// MARK: semantic
extern (C++) void objc_ClassDeclaration_semantic_PASSinit_LINKobjc(ClassDeclaration cd);
extern (C++) void objc_InterfaceDeclaration_semantic_objcExtern(InterfaceDeclaration id, Scope* sc);
// MARK: semantic
extern (C++) void objc_FuncDeclaration_semantic_setSelector(FuncDeclaration fd, Scope* sc);
extern (C++) bool objc_isUdaSelector(StructDeclaration sd);
extern (C++) void objc_FuncDeclaration_semantic_validateSelector(FuncDeclaration fd);
extern (C++) void objc_FuncDeclaration_semantic_checkLinkage(FuncDeclaration fd);
extern (C++) void objc_tryMain_dObjc();
extern (C++) void objc_tryMain_init();

View file

@ -6,13 +6,26 @@
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.objc_stubs;
module ddmd.objc;
import core.stdc.stdio;
import ddmd.dclass, ddmd.dscope, ddmd.dstruct, ddmd.func, ddmd.globals, ddmd.id, ddmd.root.stringtable;
class ObjcSelector
struct ObjcSelector
{
extern (C++) static __gshared StringTable stringtable;
extern (C++) static __gshared StringTable vTableDispatchSelectors;
extern (C++) static __gshared int incnum;
const(char)* stringvalue;
size_t stringlen;
size_t paramCount;
static void _init()
{
printf("Should never be called when D_OBJC is false\n");
assert(0);
}
// MARK: ObjcSelector
extern (D) this(const(char)* sv, size_t len, size_t pcount)
{
@ -24,26 +37,26 @@ class ObjcSelector
{
printf("Should never be called when D_OBJC is false\n");
assert(0);
return null;
}
static ObjcSelector lookup(const(char)* s, size_t len, size_t pcount)
{
printf("Should never be called when D_OBJC is false\n");
assert(0);
return null;
}
static ObjcSelector create(FuncDeclaration fdecl)
{
printf("Should never be called when D_OBJC is false\n");
assert(0);
return null;
}
}
struct Objc_ClassDeclaration
{
// true if this is an Objective-C class/interface
bool objc;
// MARK: Objc_ClassDeclaration
extern (C++) bool isInterface()
{
@ -51,6 +64,18 @@ struct Objc_ClassDeclaration
}
}
struct Objc_FuncDeclaration
{
FuncDeclaration fdecl;
// Objective-C method selector (member function only)
ObjcSelector selector;
extern (D) this(FuncDeclaration fdecl)
{
assert(0);
}
}
extern (C++) void objc_ClassDeclaration_semantic_PASSinit_LINKobjc(ClassDeclaration cd)
{
cd.error("Objective-C classes not supported");

View file

@ -634,7 +634,7 @@ MANUALSRC= \
ifeq ($(D_OBJC),1)
GENSRC += objc.d
else
MANUALSRC += objc.di objc_stubs.d
MANUALSRC += objc_stubs.d
endif
mars.d : $(SRC) $(ROOT_SRC) magicport.json $(MAGICPORT)

View file

@ -351,7 +351,7 @@ GENSRC=access.d aggregate.d aliasthis.d apply.d \
MANUALSRC= \
intrange.d complex.d \
entity.d backend.d objc.di objc_stubs.d \
entity.d backend.d objc_stubs.d \
$(ROOT)\array.d $(ROOT)\longdouble.d \
$(ROOT)\rootobject.d $(ROOT)\port.d \
$(ROOT)\rmem.d id.d impcnvtab.d