mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
debug printf: Windows path separator
This commit is contained in:
parent
1d6462532a
commit
d36cc9ea4c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Intel Corporation
|
* Copyright (c) 2015-2016, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -194,12 +194,20 @@ typedef u32 ReportID;
|
|||||||
#define unlikely(x) (x)
|
#define unlikely(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(RELEASE_BUILD) || defined(DEBUG)
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define PATH_SEP '\\'
|
||||||
|
#else
|
||||||
|
#define PATH_SEP '/'
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(DEBUG) && !defined(DEBUG_PRINTF)
|
#if defined(DEBUG) && !defined(DEBUG_PRINTF)
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define DEBUG_PRINTF(format, ...) printf("%s:%s:%d:" format, \
|
#define DEBUG_PRINTF(format, ...) printf("%s:%s:%d:" format, \
|
||||||
strrchr(__FILE__, '/') + 1, __func__, \
|
strrchr(__FILE__, PATH_SEP) + 1, \
|
||||||
__LINE__, ## __VA_ARGS__)
|
__func__, __LINE__, ## __VA_ARGS__)
|
||||||
#elif !defined(DEBUG_PRINTF)
|
#elif !defined(DEBUG_PRINTF)
|
||||||
#define DEBUG_PRINTF(format, ...) do { } while(0)
|
#define DEBUG_PRINTF(format, ...) do { } while(0)
|
||||||
#endif
|
#endif
|
||||||
@ -208,8 +216,8 @@ typedef u32 ReportID;
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define ADEBUG_PRINTF(format, ...) printf("!%s:%s:%d:" format, \
|
#define ADEBUG_PRINTF(format, ...) printf("!%s:%s:%d:" format, \
|
||||||
strrchr(__FILE__, '/') + 1, __func__, \
|
strrchr(__FILE__, PATH_SEP) + 1, \
|
||||||
__LINE__, ## __VA_ARGS__)
|
__func__, __LINE__, ## __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define ADEBUG_PRINTF(format, ...) do { } while(0)
|
#define ADEBUG_PRINTF(format, ...) do { } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user