poison.h 1.17 KB
Newer Older
1 2
#pragma once

3
#if !defined(_RELEASE) && !defined(__cplusplus) && !defined(_WIN32)
4

5 6 7 8 9 10 11 12 13 14 15 16 17 18
//
// We needed to poison certaion functions in order to disallow their usage
// but not in bundled libs
//

// this is ugly, but needed, because else compilation will fail with:
// darktable/src/common/poison.h:16:20: error: poisoning existing macro "strncat" [-Werror]
//  #pragma GCC poison strncat  // use g_strncat
#pragma GCC system_header

//#pragma GCC poison sprintf  // use snprintf
#pragma GCC poison vsprintf // use vsnprintf
#pragma GCC poison strcpy   // use g_strncpy
//#pragma GCC poison strncpy  // use g_strncpy
19 20
#pragma GCC poison strcat  // use g_strncat
#pragma GCC poison strncat // use g_strncat
21
#pragma GCC poison pthread_create // use dt_pthread_create, musl issues
22
#pragma GCC poison fopen // use g_fopen
23 24
// #pragma GCC poison open // use g_open -- this one doesn't work
#pragma GCC poison unlink // use g_unlink
25

26
#endif
27

Tobias Ellinghaus's avatar
Tobias Ellinghaus committed
28 29 30
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;