2000-07-08 06:36:27 +02:00
|
|
|
/* cygwin_crt0.cc: crt0 for cygwin
|
2000-07-01 05:51:55 +02:00
|
|
|
|
|
|
|
Copyright 2000 Cygnus Solutions.
|
|
|
|
|
|
|
|
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 06:36:27 +02:00
|
|
|
#undef __INSIDE_CYGWIN__
|
2000-07-01 05:51:55 +02:00
|
|
|
#include <windows.h>
|
2000-07-08 06:36:27 +02:00
|
|
|
#include <sys/cygwin.h>
|
2000-07-01 05:51:55 +02:00
|
|
|
#include "crt0.h"
|
|
|
|
|
2000-07-29 06:19:24 +02:00
|
|
|
#define alloca __builtin_alloca
|
|
|
|
|
2000-07-08 06:36:27 +02:00
|
|
|
extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn));
|
2000-07-01 05:51:55 +02:00
|
|
|
|
|
|
|
/* for main module */
|
|
|
|
void
|
|
|
|
cygwin_crt0 (MainFunc f)
|
|
|
|
{
|
2000-07-08 06:36:27 +02: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-17 21:18:21 +02:00
|
|
|
memset (u, 0, sizeof (u));
|
2000-07-08 06:36:27 +02:00
|
|
|
(void) _cygwin_crt0_common (f, u);
|
|
|
|
}
|
2000-10-28 07:41:44 +02:00
|
|
|
dll_crt0__FP11per_process (u); /* Jump into the dll, never to return */
|
2000-07-01 05:51:55 +02:00
|
|
|
}
|