mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
debug: cleanup ogl_tex, tex: use full-width types to avoid truncation warnings wdbg_sym.cpp: skip __suppress and __profile symbols; add additional hex display for floats; cleanup wdll_ver.cpp: cppdoc+cleanup (remove non-reentrant C interface, replace with std::string) sysdep: add cppdoc everything else: flag parameters are now consistently size_t instead of int (avoids warnings, allows slightly better code on x64) This was SVN commit r6392.
22 lines
402 B
C++
22 lines
402 B
C++
#include "precompiled.h"
|
|
|
|
#include "lib/sysdep/sysdep.h"
|
|
|
|
#define GNU_SOURCE
|
|
#include <dlfcn.h>
|
|
|
|
LibError sys_get_executable_name(char* n_path, size_t max_chars)
|
|
{
|
|
Dl_info dl_info;
|
|
|
|
memset(&dl_info, 0, sizeof(dl_info));
|
|
if (!dladdr((void *)sys_get_executable_name, &dl_info) ||
|
|
!dl_info.dli_fname )
|
|
{
|
|
return ERR::NO_SYS;
|
|
}
|
|
|
|
strncpy(n_path, dl_info.dli_fname, max_chars);
|
|
return INFO::OK;
|
|
}
|
|
|