mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Exclude main methods from dllexport.
This commit is contained in:
@@ -1061,7 +1061,7 @@ 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)
|
||||
if (decl->is_export && platform_target.os == OS_TYPE_WIN32 && decl->name != kw_main && decl->name != kw_mainstub)
|
||||
{
|
||||
LLVMSetDLLStorageClass(backend_ref, LLVMDLLExportStorageClass);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// #target: macos-x64
|
||||
module cast_expr;
|
||||
|
||||
fn int main(int argc, char** argv)
|
||||
|
||||
Reference in New Issue
Block a user