Skip to content

Commit

Permalink
i#1959: Separate C++ literals and macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
egrimley-arm committed Aug 24, 2016
1 parent 99530ca commit fd10d1b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
40 changes: 20 additions & 20 deletions core/lib/globals_shared.h
Expand Up @@ -906,7 +906,7 @@ typedef int stats_int_t;
* there and then disallow %x, to try and avoid 64-bit printing bugs,
* but it wouldn't be a panacea.
*/
#define L_UINT64_FORMAT_STRING L"%"L_EXPAND_LEVEL(UINT64_FORMAT_CODE)
#define L_UINT64_FORMAT_STRING L"%" L_EXPAND_LEVEL(UINT64_FORMAT_CODE)
#ifdef X64
# define PFMT ZHEX64_FORMAT_STRING
# define PIFMT HEX64_FORMAT_STRING
Expand All @@ -922,9 +922,9 @@ typedef int stats_int_t;
# define SZFC "u"
# define SSZFC "d"
#endif
#define L_PFMT L"%016"L_EXPAND_LEVEL(INT64_FORMAT)L"x"
#define PFX "0x"PFMT
#define PIFX "0x"PIFMT
#define L_PFMT L"%016" L_EXPAND_LEVEL(INT64_FORMAT)L"x"
#define PFX "0x" PFMT
#define PIFX "0x" PIFMT

/* DR_API EXPORT BEGIN */
/* printf codes for {thread,process}_id_t */
Expand Down Expand Up @@ -1026,14 +1026,14 @@ typedef char liststring_t[MAX_LIST_OPTION_LENGTH];
#define BUG_REPORT_URL "http://dynamorio.org/issues/"

#ifdef BUILD_NUMBER
# define BUILD_NUMBER_STRING "build "STRINGIFY(BUILD_NUMBER)
# define BUILD_NUMBER_STRING "build " STRINGIFY(BUILD_NUMBER)
#else
# define BUILD_NUMBER_STRING "custom build"
# define BUILD_NUMBER (0)
#endif

#ifdef VERSION_NUMBER
# define VERSION_NUMBER_STRING "version "STRINGIFY(VERSION_NUMBER)
# define VERSION_NUMBER_STRING "version " STRINGIFY(VERSION_NUMBER)
#else
# define VERSION_NUMBER_STRING "internal version"
# define VERSION_NUMBER (0.0)
Expand Down Expand Up @@ -1176,7 +1176,7 @@ typedef char liststring_t[MAX_LIST_OPTION_LENGTH];

# define EVENTLOG_REGISTRY_SUBKEY "System\\CurrentControlSet\\Services\\EventLog"
# define L_EVENTLOG_REGISTRY_SUBKEY L_EXPAND_LEVEL(EVENTLOG_REGISTRY_SUBKEY)
# define L_EVENTLOG_REGISTRY_KEY L"\\Registry\\Machine\\"L_EXPAND_LEVEL(EVENTLOG_REGISTRY_SUBKEY)
# define L_EVENTLOG_REGISTRY_KEY L"\\Registry\\Machine\\" L_EXPAND_LEVEL(EVENTLOG_REGISTRY_SUBKEY)
# define L_EVENT_LOG_KEY LCONCAT(L_EVENTLOG_REGISTRY_KEY,EVENTLOG_NAME)
# define L_EVENT_LOG_SUBKEY LCONCAT(L_EVENTLOG_REGISTRY_SUBKEY,EVENTLOG_NAME)
# define L_EVENT_LOG_NAME L_EXPAND_LEVEL(EVENTLOG_NAME)
Expand All @@ -1193,9 +1193,9 @@ typedef char liststring_t[MAX_LIST_OPTION_LENGTH];
* installer doesn't work yet xref case 8482).*/
# define L_EVENT_FILE_VALUE_NAME L"File"
# define L_EVENT_FILE_NAME_PRE_VISTA \
L"%SystemRoot%\\system32\\config\\"L_EXPAND_LEVEL(EVENTLOG_NAME)L".evt"
L"%SystemRoot%\\system32\\config\\" L_EXPAND_LEVEL(EVENTLOG_NAME)L".evt"
# define L_EVENT_FILE_NAME_VISTA \
L"%SystemRoot%\\system32\\winevt\\logs\\"L_EXPAND_LEVEL(EVENTLOG_NAME)L".elf"
L"%SystemRoot%\\system32\\winevt\\logs\\" L_EXPAND_LEVEL(EVENTLOG_NAME)L".elf"
# define L_EVENT_MAX_SIZE_NAME L"MaxSize"
# define EVENT_MAX_SIZE 0x500000
# define L_EVENT_RETENTION_NAME L"Retention"
Expand All @@ -1216,11 +1216,11 @@ typedef char liststring_t[MAX_LIST_OPTION_LENGTH];
# define DYNAMORIO_SHARED_OBJECT_DIRECTORY LCONCAT(DYNAMORIO_SHARED_OBJECT_BASE, "SharedCache")

/* registry */
# define DYNAMORIO_REGISTRY_BASE_SUBKEY "Software\\"COMPANY_NAME"\\"PRODUCT_NAME
# define DYNAMORIO_REGISTRY_BASE L"\\Registry\\Machine\\Software\\"L_EXPAND_LEVEL(COMPANY_NAME)L("\\")L_EXPAND_LEVEL(PRODUCT_NAME)
# define DYNAMORIO_REGISTRY_BASE_SUBKEY "Software\\" COMPANY_NAME "\\" PRODUCT_NAME
# define DYNAMORIO_REGISTRY_BASE L"\\Registry\\Machine\\Software\\" L_EXPAND_LEVEL(COMPANY_NAME)L("\\")L_EXPAND_LEVEL(PRODUCT_NAME)
# define DYNAMORIO_REGISTRY_HIVE HKEY_LOCAL_MACHINE
# define DYNAMORIO_REGISTRY_KEY DYNAMORIO_REGISTRY_BASE_SUBKEY
# define L_DYNAMORIO_REGISTRY_KEY L"Software\\"L_EXPAND_LEVEL(COMPANY_NAME)L"\\"L_EXPAND_LEVEL(PRODUCT_NAME)
# define L_DYNAMORIO_REGISTRY_KEY L"Software\\" L_EXPAND_LEVEL(COMPANY_NAME)L"\\" L_EXPAND_LEVEL(PRODUCT_NAME)

# define INJECT_ALL_HIVE HKEY_LOCAL_MACHINE
# define INJECT_ALL_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
Expand Down Expand Up @@ -1261,17 +1261,17 @@ typedef char liststring_t[MAX_LIST_OPTION_LENGTH];

/* for processview, etc */
# define DYNAMORIO_LIBRARY_NAME "dynamorio.dll"
# define DLLPATH_RELEASE "\\lib\\release\\"DYNAMORIO_LIBRARY_NAME
# define DLLPATH_DEBUG "\\lib\\debug\\"DYNAMORIO_LIBRARY_NAME
# define DLLPATH_PROFILE "\\lib\\profile\\"DYNAMORIO_LIBRARY_NAME
# define DLLPATH_RELEASE "\\lib\\release\\" DYNAMORIO_LIBRARY_NAME
# define DLLPATH_DEBUG "\\lib\\debug\\" DYNAMORIO_LIBRARY_NAME
# define DLLPATH_PROFILE "\\lib\\profile\\" DYNAMORIO_LIBRARY_NAME

# define L_DYNAMORIO_LIBRARY_NAME L_EXPAND_LEVEL(DYNAMORIO_LIBRARY_NAME)
# define L_DLLPATH_RELEASE L"\\lib\\release\\"L_DYNAMORIO_LIBRARY_NAME
# define L_DLLPATH_DEBUG L"\\lib\\debug\\"L_DYNAMORIO_LIBRARY_NAME
# define L_DLLPATH_PROFILE L"\\lib\\profile\\"L_DYNAMORIO_LIBRARY_NAME
# define L_DLLPATH_RELEASE L"\\lib\\release\\" L_DYNAMORIO_LIBRARY_NAME
# define L_DLLPATH_DEBUG L"\\lib\\debug\\" L_DYNAMORIO_LIBRARY_NAME
# define L_DLLPATH_PROFILE L"\\lib\\profile\\" L_DYNAMORIO_LIBRARY_NAME

# define INJECT_ALL_DLL_SUBPATH "\\lib\\"INJECT_DLL_8_3_NAME
# define L_INJECT_ALL_DLL_SUBPATH L"\\lib\\"L_EXPAND_LEVEL(INJECT_DLL_8_3_NAME)
# define INJECT_ALL_DLL_SUBPATH "\\lib\\" INJECT_DLL_8_3_NAME
# define L_INJECT_ALL_DLL_SUBPATH L"\\lib\\" L_EXPAND_LEVEL(INJECT_DLL_8_3_NAME)

enum DLL_TYPE {
DLL_NONE,
Expand Down
12 changes: 6 additions & 6 deletions suite/tests/client-interface/events.dll.c
Expand Up @@ -418,18 +418,18 @@ bool exception_event_redirect(void *dcontext, dr_exception_t *excpt)
{
app_pc addr;
dr_mcontext_t mcontext = {sizeof(mcontext),DR_MC_ALL,};
module_data_t *data = dr_lookup_module_by_name("client."EVENTS".exe");
module_data_t *data = dr_lookup_module_by_name("client." EVENTS".exe");
dr_fprintf(STDERR, "exception event redirect\n");
if (data == NULL) {
dr_fprintf(STDERR, "couldn't find "EVENTS".exe module\n");
dr_fprintf(STDERR, "couldn't find " EVENTS".exe module\n");
return true;
}
addr = (app_pc)dr_get_proc_address(data->handle, "redirect");
dr_free_module_data(data);
mcontext = *excpt->mcontext;
mcontext.pc = addr;
if (addr == NULL) {
dr_fprintf(STDERR, "Couldn't find function redirect in "EVENTS".exe\n");
dr_fprintf(STDERR, "Couldn't find function redirect in " EVENTS".exe\n");
return true;
}
# ifdef X86_64
Expand Down Expand Up @@ -474,16 +474,16 @@ dr_signal_action_t signal_event_redirect(void *dcontext, dr_siginfo_t *info)
{
if (info->sig == SIGSEGV) {
app_pc addr;
module_data_t *data = dr_lookup_module_by_name("client."EVENTS);
module_data_t *data = dr_lookup_module_by_name("client." EVENTS);
dr_fprintf(STDERR, "signal event redirect\n");
if (data == NULL) {
dr_fprintf(STDERR, "couldn't find client."EVENTS" module\n");
dr_fprintf(STDERR, "couldn't find client." EVENTS" module\n");
return DR_SIGNAL_DELIVER;
}
addr = (app_pc)dr_get_proc_address(data->handle, "redirect");
dr_free_module_data(data);
if (addr == NULL) {
dr_fprintf(STDERR, "Couldn't find function redirect in client."EVENTS"\n");
dr_fprintf(STDERR, "Couldn't find function redirect in client." EVENTS"\n");
return DR_SIGNAL_DELIVER;
}
# ifdef X86_64
Expand Down

0 comments on commit fd10d1b

Please sign in to comment.