mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-29 20:48:02 +08:00
eaef5bd133
This reverts commit 1a17e17c462bdd4e1d26d8742f8b7087273e04c2. PUBLISHED_FROM=80028de308c9a021955d1425d2bfee8feb85f193
30 lines
824 B
C
30 lines
824 B
C
/*
|
|
* Copyright (c) 2014-2016 Cesanta Software Limited
|
|
* All rights reserved
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
|
|
/*
|
|
* STM's startup script requires __libc_init_array for successfull
|
|
* initialization.
|
|
* Oficially supported IDE (Keil, IAR...) provide this function.
|
|
* We use our own
|
|
*/
|
|
|
|
extern void (*__preinit_array_start[])(void) __attribute__((weak));
|
|
extern void (*__preinit_array_end[])(void) __attribute__((weak));
|
|
extern void (*__init_array_start[])(void) __attribute__((weak));
|
|
extern void (*__init_array_end[])(void) __attribute__((weak));
|
|
|
|
void __libc_init_array(void) {
|
|
size_t count;
|
|
size_t i;
|
|
|
|
count = __preinit_array_end - __preinit_array_start;
|
|
for (i = 0; i < count; i++) __preinit_array_start[i]();
|
|
|
|
count = __init_array_end - __init_array_start;
|
|
for (i = 0; i < count; i++) __init_array_start[i]();
|
|
}
|