aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/mingw/misc/_onexit.c
blob: a51fa3fc9058c0e83e786c67dafe18e892caf64c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the mingw-w64 runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */

#include <stdlib.h>

_onexit_t __cdecl _onexit(_onexit_t func)
{
  return atexit((void (__cdecl *)(void))func) == 0 ? func : NULL;
}
_onexit_t __cdecl (*__MINGW_IMP_SYMBOL(_onexit))(_onexit_t func) = _onexit;

_onexit_t __attribute__ ((alias ("_onexit"))) __cdecl onexit(_onexit_t);
extern _onexit_t (__cdecl * __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(_onexit))))) __MINGW_IMP_SYMBOL(onexit))(_onexit_t);