/
githubmirror
/
libsmbios
Обзор
Документация
Войти
/
githubmirror
/
libsmbios
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/libsmbios_c/common/common.c
35 строк
1 KB
Mario Limonciello
Drop Solaris support
23 янв 2018, 19:39
23 янв 2018, 19:39
ca7b0be
Код
Авторство
О чём код?
#define LIBSMBIOS_C_SOURCE #define DEBUG_MODULE_NAME "DEBUG_CONSTRUCTOR_C" #include "smbios_c/compat.h" #include <string.h> #include "common_internal.h" #include "libsmbios_c_intlize.h" // constructor to set up locale stuff __attribute__((constructor)) static void lib_initialize (void) { fnprintf("CONSTRUCTOR: pkg: %s, dir: %s\n", GETTEXT_PACKAGE,LIBSMBIOS_LOCALEDIR); bindtextdomain (GETTEXT_PACKAGE, LIBSMBIOS_LOCALEDIR); fnprintf( LIBSMBIOS_C_GETTEXT_DEBUG_STRING "\n"); fnprintf( _("This message should be localized if setlocale() has been called and gettext compiled in.\n") ); } #ifdef LIBSMBIOS_C_PLATFORM_LINUX void fixed_strerror(int errval, char *errbuf, size_t bufsize) { fnprintf("\n"); size_t curstrsize = strlen(errbuf); if ((size_t)(bufsize - curstrsize - 1) < bufsize) { char *buf = strerror_r(errval, errbuf + curstrsize, bufsize - curstrsize - 1); // GNU breakage... :( if (buf != (errbuf + curstrsize)) strlcat(errbuf, buf, bufsize); } } #endif