ReactOS 0.4.16-dev-963-g182f353
initterm.cpp
Go to the documentation of this file.
1//
2// initterm.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// _initterm and _initterm_e functions used during dynamic initialization.
7//
8#include <corecrt_internal.h>
9
10
11
12// Calls each function in [first, last). [first, last) must be a valid range of
13// function pointers. Each function is called, in order.
14extern "C" void __cdecl _initterm(_PVFV* const first, _PVFV* const last)
15{
16 for (_PVFV* it = first; it != last; ++it)
17 {
18 if (*it == nullptr)
19 continue;
20
21 (**it)();
22 }
23}
24
25// Calls each function in [first, last). [first, last) must be a valid range of
26// function pointers. Each function must return zero on success, nonzero on
27// failure. If any function returns nonzero, iteration stops immediately and
28// the nonzero value is returned. Otherwise all functions are called and zero
29// is returned.
30//
31// If a nonzero value is returned, it is expected to be one of the runtime error
32// values (_RT_{NAME}, defined in the internal header files).
33extern "C" int __cdecl _initterm_e(_PIFV* const first, _PIFV* const last)
34{
35 for (_PIFV* it = first; it != last; ++it)
36 {
37 if (*it == nullptr)
38 continue;
39
40 int const result = (**it)();
41 if (result != 0)
42 return result;
43 }
44
45 return 0;
46}
#define __cdecl
Definition: accygwin.h:79
int(__cdecl * _PIFV)(void)
void(__cdecl * _PVFV)(void)
const GLint * first
Definition: glext.h:5794
GLuint64EXT * result
Definition: glext.h:11304
void __cdecl _initterm(_PVFV *const first, _PVFV *const last)
Definition: initterm.cpp:14
int __cdecl _initterm_e(_PIFV *const first, _PIFV *const last)
Definition: initterm.cpp:33
static UINT UINT last
Definition: font.c:45