[LazyLoading] Gather up scattered script modification of python script 52/325652/3
authorWonsuk Jung <ws29.jung@samsung.com>
Fri, 13 Jun 2025 02:45:15 +0000 (11:45 +0900)
committerInsoon Kim <is46.kim@samsung.com>
Fri, 13 Jun 2025 06:56:02 +0000 (06:56 +0000)
This patch sums up all different modification made to |build_tizen_proxy.py|
python script, so from now on, patches only need to modify actually codes and json files.

Change-Id: Ia15c38e368c33014f360ffff7c9b1fb35e1c7f37
Signed-off-by: Wonsuk Jung <ws29.jung@samsung.com>
tizen_src/platform/build_tizen_proxy.py

index df1b837abb8ad2e603255f96a072df55ea383c3e..b88dd947014ea759716488da1920d908b0ac7d72 100644 (file)
@@ -193,7 +193,10 @@ def extract_function_elements(function_declaration):
 
     # Extract return type
     return_type_part = parts[0].strip()
-    return_type = return_type_part.split()[0]  # First word is the return type
+    modifiers = return_type_part.split()[0]
+    return_type = modifiers
+    if modifiers == "EAPI":
+        return_type = modifiers + " " + return_type_part.split()[1]
 
     # Extract parameter list
     params_part = parts[1].rstrip(');').strip()
@@ -212,14 +215,17 @@ def generate_function_body(class_name, function_name, return_type, params):
         if len(parts) >= 2:
             param_type = ' '.join(parts[:-1])  # First part is the type
             if parts[-1].startswith('*'):
-                param_type += '*'  # Preserve pointer symbol with the type
+                if parts[-1].count('*') == 1:
+                    param_type += '*'  # Preserve pointer symbol with the type
+                elif parts[-1].count('*') == 2:
+                    param_type += '**'  # Preserve pointer symbol with the type
             param_name = ' '.join(parts[-1:]).lstrip('*')  # Remaining parts are the name, remove pointer symbol
             param_types.append(param_type)
             param_names.append(param_name)
 
     function_body = f'{return_type} {class_name}::{function_name}({", ".join(params)}) {{\n'
     function_body += f'  auto func =\n'
-    function_body += f'      reinterpret_cast<int (*)({", ".join(param_types)})>(dlsym_helper(handle_, "{function_name}"));\n'
+    function_body += f'      reinterpret_cast<{return_type} (*)({", ".join(param_types)})>(dlsym_helper(handle_, "{function_name}"));\n'
     function_body += f'  return func({", ".join(param_names)});\n'
     function_body += '}\n'