mirror of
https://github.com/yuzu-emu/AppImageKit-checkrt.git
synced 2025-01-27 10:21:00 +00:00
Merge pull request #7 from pamarcos/standalone_debug_log
Move DEBUG macro to own header to be a standalone helper
This commit is contained in:
commit
aeec550898
|
@ -18,6 +18,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
#include "debug.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -47,7 +48,6 @@
|
|||
|
||||
char *optional = NULL;
|
||||
char *optional_ld_preload = NULL;
|
||||
int debug_flag = 0;
|
||||
|
||||
void checkrt(char *usr_in_appdir)
|
||||
{
|
||||
|
@ -63,8 +63,6 @@ void checkrt(char *usr_in_appdir)
|
|||
char *gcc_bundle_lib = "./" GCCDIR "/libgcc_s.so.1";
|
||||
const char *format = "tr '\\0' '\\n' < '%s' | grep -e '%s' | tail -n1";
|
||||
|
||||
debug_flag = getenv("APPIMAGE_CHECKRT_DEBUG") ? 1 : 0;
|
||||
|
||||
if (access(stdcxx_bundle_lib, F_OK) == 0) {
|
||||
f = popen("ldconfig -p | grep 'libstdc++.so.6 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r");
|
||||
ret = fscanf(f, "%s", stdcxx_sys_lib); (void)ret;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef CHEKRT_H
|
||||
#define CHECKRT_H
|
||||
|
||||
extern char *optional;
|
||||
extern char *optional_ld_preload;
|
||||
extern void checkrt(char *usr_in_appdir);
|
||||
extern int debug_flag;
|
||||
|
||||
#define DEBUG(...) do { \
|
||||
if (debug_flag) \
|
||||
printf(__VA_ARGS__); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
|
11
debug.h
Normal file
11
debug.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define DEBUG(...) do { \
|
||||
if (getenv("APPIMAGE_CHECKRT_DEBUG")) \
|
||||
printf(__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif // DEBUG_H
|
Loading…
Reference in a new issue