mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Update libretro-common
This commit is contained in:
parent
6c90b63835
commit
e37f5a2465
@ -33,6 +33,25 @@ def noext(sym):
|
||||
return False
|
||||
return True
|
||||
|
||||
def fix_multiline_functions(lines):
|
||||
fixed_lines = []
|
||||
temp_lines = []
|
||||
for line in lines:
|
||||
if line.count('(') > line.count(')'):
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
if len(temp_lines) > 0:
|
||||
if line.count(')') > line.count('('):
|
||||
temp_lines.append(line)
|
||||
fixed_line = re.sub(' +',' ', ''.join(temp_lines).replace('\n','').replace('\t',''))
|
||||
fixed_lines.append(fixed_line)
|
||||
temp_lines = []
|
||||
else:
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
fixed_lines.append(line)
|
||||
return fixed_lines
|
||||
|
||||
def find_gl_symbols(lines):
|
||||
typedefs = []
|
||||
syms = []
|
||||
@ -68,7 +87,7 @@ if __name__ == '__main__':
|
||||
banned_ext.append(banned)
|
||||
|
||||
with open(sys.argv[1], 'r') as f:
|
||||
lines = f.readlines()
|
||||
lines = fix_multiline_functions(f.readlines())
|
||||
typedefs, syms = find_gl_symbols(lines)
|
||||
|
||||
overrides = generate_defines(syms)
|
||||
|
@ -33,6 +33,25 @@ def noext(sym):
|
||||
return False
|
||||
return True
|
||||
|
||||
def fix_multiline_functions(lines):
|
||||
fixed_lines = []
|
||||
temp_lines = []
|
||||
for line in lines:
|
||||
if line.count('(') > line.count(')'):
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
if len(temp_lines) > 0:
|
||||
if line.count(')') > line.count('('):
|
||||
temp_lines.append(line)
|
||||
fixed_line = re.sub(' +',' ', ''.join(temp_lines).replace('\n','').replace('\t',''))
|
||||
fixed_lines.append(fixed_line)
|
||||
temp_lines = []
|
||||
else:
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
fixed_lines.append(line)
|
||||
return fixed_lines
|
||||
|
||||
def find_gl_symbols(lines):
|
||||
typedefs = []
|
||||
syms = []
|
||||
@ -68,7 +87,7 @@ if __name__ == '__main__':
|
||||
banned_ext.append(banned)
|
||||
|
||||
with open(sys.argv[1], 'r') as f:
|
||||
lines = f.readlines()
|
||||
lines = fix_multiline_functions(f.readlines())
|
||||
typedefs, syms = find_gl_symbols(lines)
|
||||
|
||||
overrides = generate_defines(syms)
|
||||
|
@ -33,6 +33,25 @@ def noext(sym):
|
||||
return False
|
||||
return True
|
||||
|
||||
def fix_multiline_functions(lines):
|
||||
fixed_lines = []
|
||||
temp_lines = []
|
||||
for line in lines:
|
||||
if line.count('(') > line.count(')'):
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
if len(temp_lines) > 0:
|
||||
if line.count(')') > line.count('('):
|
||||
temp_lines.append(line)
|
||||
fixed_line = re.sub(' +',' ', ''.join(temp_lines).replace('\n','').replace('\t',''))
|
||||
fixed_lines.append(fixed_line)
|
||||
temp_lines = []
|
||||
else:
|
||||
temp_lines.append(line)
|
||||
else:
|
||||
fixed_lines.append(line)
|
||||
return fixed_lines
|
||||
|
||||
def find_gl_symbols(lines):
|
||||
typedefs = []
|
||||
syms = []
|
||||
@ -69,7 +88,7 @@ if __name__ == '__main__':
|
||||
banned_ext.append(banned)
|
||||
|
||||
with open(sys.argv[1], 'r') as f:
|
||||
lines = f.readlines()
|
||||
lines = fix_multiline_functions(f.readlines())
|
||||
typedefs, syms = find_gl_symbols(lines)
|
||||
|
||||
overrides = generate_defines(syms)
|
||||
|
@ -482,8 +482,7 @@ int filestream_close(RFILE *stream)
|
||||
*
|
||||
* Read the contents of a file into @buf.
|
||||
*
|
||||
* Returns: 1 on success, 0 on failure
|
||||
* In the error case, the dereferenced buf is set to NULL and the len is set to -1.
|
||||
* Returns: number of items read, -1 on error.
|
||||
*/
|
||||
int64_t filestream_read_file(const char *path, void **buf, int64_t *len)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user