mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Add DLL export for exported functions on win32.
This commit is contained in:
@@ -1042,6 +1042,10 @@ LLVMValueRef llvm_get_ref(GenContext *c, Decl *decl)
|
||||
}
|
||||
assert(decl->var.kind == VARDECL_GLOBAL || decl->var.kind == VARDECL_CONST);
|
||||
llvm_add_global_decl(c, decl);
|
||||
if (decl->is_export && platform_target.os == OS_TYPE_WIN32)
|
||||
{
|
||||
LLVMSetDLLStorageClass(decl->backend_ref, LLVMDLLExportStorageClass);
|
||||
}
|
||||
return decl->backend_ref;
|
||||
case DECL_FUNC:
|
||||
if (decl->func_decl.attr_interface)
|
||||
@@ -1057,6 +1061,10 @@ LLVMValueRef llvm_get_ref(GenContext *c, Decl *decl)
|
||||
}
|
||||
backend_ref = decl->backend_ref = LLVMAddFunction(c->module, decl_get_extname(decl), llvm_get_type(c, decl->type));
|
||||
llvm_append_function_attributes(c, decl);
|
||||
if (decl->is_export && platform_target.os == OS_TYPE_WIN32)
|
||||
{
|
||||
LLVMSetDLLStorageClass(backend_ref, LLVMDLLExportStorageClass);
|
||||
}
|
||||
if (decl_is_local(decl))
|
||||
{
|
||||
assert(decl->unit->module == c->code_module);
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.4.515"
|
||||
#define COMPILER_VERSION "0.4.516"
|
||||
Reference in New Issue
Block a user