master
 1/**
 2 * This file has no copyright assigned and is placed in the Public Domain.
 3 * This file is part of the mingw-w64 runtime package.
 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 5 */
 6
 7#undef __MSVCRT_VERSION__
 8#define _UCRT
 9
10#include <stdlib.h>
11#include <corecrt_startup.h>
12
13extern char __mingw_module_is_dll;
14
15int __cdecl at_quick_exit(void (__cdecl *func)(void))
16{
17  // In a DLL, we can't register a function with _crt_at_quick_exit, because
18  // we can't unregister it when the DLL is unloaded. This matches how
19  // at_quick_exit/quick_exit work with MSVC with a dynamically linked CRT.
20  if (__mingw_module_is_dll)
21    return 0;
22  return _crt_at_quick_exit(func);
23}
24int __cdecl (*__MINGW_IMP_SYMBOL(at_quick_exit))(void (__cdecl *)(void)) = at_quick_exit;