2000-07-08 12:36:27 +08:00
|
|
|
/* cygwin_crt0.cc: crt0 for cygwin
|
2000-07-01 11:51:55 +08:00
|
|
|
|
2001-09-12 04:01:02 +08:00
|
|
|
Copyright 2000, 2001 Red Hat, Inc.
|
2000-07-01 11:51:55 +08:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2000-07-08 12:36:27 +08:00
|
|
|
#undef __INSIDE_CYGWIN__
|
2000-07-01 11:51:55 +08:00
|
|
|
#include <windows.h>
|
2000-07-08 12:36:27 +08:00
|
|
|
#include <sys/cygwin.h>
|
2001-11-14 18:47:54 +08:00
|
|
|
#include <stdlib.h>
|
2000-07-01 11:51:55 +08:00
|
|
|
#include "crt0.h"
|
|
|
|
|
2000-07-08 12:36:27 +08:00
|
|
|
extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn));
|
2000-07-01 11:51:55 +08:00
|
|
|
|
|
|
|
/* for main module */
|
|
|
|
void
|
|
|
|
cygwin_crt0 (MainFunc f)
|
|
|
|
{
|
2000-07-08 12:36:27 +08:00
|
|
|
struct per_process *u;
|
|
|
|
if (_cygwin_crt0_common (f, NULL))
|
|
|
|
u = NULL; /* Newer DLL. Use DLL internal per_process. */
|
|
|
|
else /* Older DLL. Provide a per_process */
|
|
|
|
{
|
|
|
|
u = (struct per_process *) alloca (sizeof (*u));
|
2000-07-18 03:18:21 +08:00
|
|
|
memset (u, 0, sizeof (u));
|
2000-07-08 12:36:27 +08:00
|
|
|
(void) _cygwin_crt0_common (f, u);
|
|
|
|
}
|
2000-10-28 13:41:44 +08:00
|
|
|
dll_crt0__FP11per_process (u); /* Jump into the dll, never to return */
|
2000-07-01 11:51:55 +08:00
|
|
|
}
|