Forum > Other OS

Define not found. Android - ARMv7.

<< < (2/3) > >>

Laksen:
Try to run
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---fpc -Parm -Cparmv7a -va
Somewhere it should show:
--- Code: ---[0.000] Macro defined: CPUARMV7A
--- End code ---

Josh:
i dont use android, but curios to see with the following, if eith Android32 or Android64 gets defined

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IFDEF ANDROID}{$ifdef CPU32}{$Define Android32}{$endif}{$ifdef CPU64}{$Define Android64}{$endif}{$Endif}           

Seenkao:
Laksen, ты не хочешь понять, что данного определения нет для Android.

Josh, да, я вспомнил. Это стандартные определения... Но это получается что сам пользователь должен следить за тем, под какой процессор идёт разработка.
Есть над чем подумать.  :)

Google translate:
Laksen, you do not want to understand that this definition does not exist for Android.

Josh, yes, I remember. These are standard definitions... But it turns out that the user himself must keep track of which processor is being developed.
There is something to think about. :)

Josh:
Hi Seenkao,

Just curious as to the type of App are you develping?

Excuse the text below, as am sure you are aware of it, but other people reading in future may not.

Normally the 'user' is not aware or even care about the cpu being used.
The developer will generally create various binaries for each platform the app supports, nowadays when you deploy the app as a package it will contain the binaries for which ever cpu(s) you support, to the user when installing the package the os will choose the app in the package that is for the cpu its running on. With Windows/Mac the installer will contain both X86-64 and Aarch64/M1 executables as a combined installer.

Each binary will be optimized for the architecture at compile time.

As the developer the ifdef are used generally to set any specific vars that defer between os/widgetset  builds for your app to work/display properly, and to allow you to have a std function that return a value for the specific os.
ie pseudo code

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function getmydocslocation:ansistring;begin  {$ifdef windows}  result:=use windows api call to get value;  {$endif}  {$ifdef darwin}  result:=use macos apicall to get value;  {$endif}end; 
This is indeed what a lot of the lcl does for its controls, as most are wrappers around the os's native widgets or indeed specific widgetsets gtk2,3,qt etc.

I have myself a unit called my_standard_functions, which has obviously my own standard routines, but also contains other functions the set/get variables needed for other code, theses functions have various ifdef and nested ifdef to set get values. But makes the rest of my code much easier to read as other units do not contain ifdef, and if something changes i just alter my_standard_functions unit, then any app i have created i can just recompile as it will compile using the moded standard_functions unit.

Seenkao:
Josh, ZenGL.  :)
https://forum.lazarus.freepascal.org/index.php/topic,49143.0.html

Я думал у меня отображается информация... но по непонятной причине все ссылки обнулились.
Сейчас скомпилировал многие библиотеки для архитектур v7a и v8a, и отделить v7a не могу от более старых архитектур. Это вызовет проблемы у конечного пользователя ZenGL. Ведь пользователь будет создавать свои приложения. А указав нужную ему архитектуру, код который не должен работать с данной архитектурой может сработать. Вот и ищу метод предотвратить подобные проблемы.  :(

Google translate:
I thought I was displaying information ... but for some unknown reason, all links were reset to zero.
Now I have compiled many libraries for v7a and v8a architectures, and I cannot separate v7a from older architectures. This will cause problems for the end user of ZenGL. After all, the user will create their own applications. And by specifying the architecture he needs, the code that should not work with this architecture can work. So I'm looking for a way to prevent such problems. :(

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version