-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
39 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.obj | ||
*.exp | ||
*.lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
#if defined(WINNT) | ||
#define MYLIB_API __declspec(dllexport) | ||
#else | ||
#define MYLIB_API | ||
#endif | ||
|
||
long MyFunction(int *foo, int bar) | ||
long MYLIB_API MyFunction(int *foo, int bar) | ||
{ | ||
return *foo + bar; | ||
} | ||
|
||
class MyClass { | ||
class MYLIB_API MyClass { | ||
public: | ||
long attr; | ||
}; | ||
|
||
MyClass* GetObject(int attr) | ||
MyClass MYLIB_API *GetObject(int attr) | ||
{ | ||
MyClass *obj = new MyClass(); | ||
obj->attr = attr; | ||
return obj; | ||
} | ||
|
||
long GetObjectAttr(MyClass *obj) | ||
long MYLIB_API GetObjectAttr(MyClass *obj) | ||
{ | ||
return obj->attr; | ||
} | ||
|
||
namespace MyNS { | ||
namespace MySubNS { | ||
long MyNSFunction(long foo) | ||
long MYLIB_API MyNSFunction(long foo) | ||
{ | ||
return foo + 1; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
cl /Folibc.obj /c lib.c /nologo | ||
link /nologo /dll /out:libc.dll /implib:fooc.lib libc.obj | ||
|
||
cl /Folibcpp.obj /c lib.cpp /nologo | ||
link /nologo /dll /out:libcpp.dll /implib:foocpp.lib libcpp.obj | ||
cl /DWINNT lib.c /Fec.dll /LD | ||
|
||
cl /DWINNT lib.cpp /Fecpp.dll /LD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters