Make sure window id hex starts with 0x (makes monitor recording more reliable), allow CC and CXX to set compiler for build

This commit is contained in:
dec05eba
2023-06-04 13:49:47 +02:00
parent 41176177c6
commit 7e2ade27a7
3 changed files with 34 additions and 23 deletions

View File

@@ -732,20 +732,26 @@ static bool is_hex_num(char c) {
}
static bool contains_non_hex_number(const char *str) {
bool hex_start = false;
size_t len = strlen(str);
if(len >= 2 && memcmp(str, "0x", 2) == 0) {
str += 2;
len -= 2;
hex_start = true;
}
bool is_hex = false;
for(size_t i = 0; i < len; ++i) {
char c = str[i];
if(c == '\0')
return false;
if(!is_hex_num(c))
return true;
if((c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
is_hex = true;
}
return false;
return is_hex && !hex_start;
}
static std::string get_date_str() {