Showing with 32 additions and 66 deletions.
  1. +0 −59 src/objc.di
  2. +30 −5 src/objc_stubs.d
  3. +1 −1 src/posix.mak
  4. +1 −1 src/win32.mak
59 changes: 0 additions & 59 deletions src/objc.di

This file was deleted.

35 changes: 30 additions & 5 deletions src/objc_stubs.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -24,33 +37,45 @@ 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()
{
return false;
}
}

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");
Expand Down
2 changes: 1 addition & 1 deletion src/posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down