Forum > Other OS

Define not found. Android - ARMv7.

(1/3) > >>

Seenkao:
  Мне надо определить в конфигурации проекта архитектуру ARMv7a. Или хотя бы ARMv7. Но для Android нет определений данной конфигурации. Самая последняя конфигурация это CPUARMV5T.

  Я могу через какие-то другие конфигурации это реализовать?

Google translate:
  I need to define the ARMv7a architecture in the project configuration. Or at least ARMv7. But for Android, there are no definitions for this configuration. The latest configuration is CPUARMV5T.

   Can I implement this through some other configurations?

example:

--- 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 CPUi386}  ...  z := z + 1;  ...{$EndIf}{$IfDef CPUARMV7A}    // does not exist  ...  z := z - 4;  ...{$EndIf}

Laksen:
What do you mean with configurations for that? CPUARMV7A has been supported for years

Josh:
If you have multiple build options for you project then you can create a build for your CPU
then in project option/custom defines create a new define called YourCPU

then you can use
{$ifdef YourCPU}
code only compiled for this define
{$endif}


Seenkao:
Мне надо в программе с помощью IfDef (Define) определить тип архитектуры. Если вы попытаетесь использовать код который я написал, он не будет работать для архитектуры V7A для Android.

Как я могу определить что программист использует архитектуру V7A для Android?

Josh, благодарю! Это, видимо самое подходящее для меня решение. А есть возможность определить define программно? Например в конфигурации проекта.

Google translate:
I need to use IfDef (Define) to define the type of architecture in the program. If you try to use the code I wrote, it will not work for the V7A architecture for Android.

How can I tell if a programmer is using the V7A architecture for Android?

Josh, thank you! This seems to be the best solution for me. Is it possible to define define programmatically? For example in the project configuration.

Josh:
Yes you can create define programmatically, but remember its a compiled not interpreted.

{$define CPUARMv7}

this would need to be in early on in unit, or in the lpr file.

you can do things like
{$ifdef CPUARMv7}
{$Define OPTION_1}
{$EndIf}

{$ifdef CPUARMv8}
{$Define OPTION_2}
{$EndIf}

{$ifdef CPUARMv9}
{$Define OPTION_3}
{$EndIf}


remember only code with in an active define block will be compiled.

if its to do with offsets or variable definitions etc, you could do something like :-

pseudo code, not tested


--- 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";}};} ---procedure setmydefaults;var opt_t:integer=0; // default value function set_integer(ADef,AVal1,AVal2,AVal3:Integer):Integer;begin   result:=ADef;   Case opt_t of       0:Result:=ADef;      1:Result:=AVal1;      2:Result:=AVal2;      3:Result:=AVal3;    end;end; begin  // define one of these in code before calling setmydefaults to use the option  //  however you could also set this value before setting your defaullts, ie  //  from params of commandline, or by using code that detects whatever criteria is  // this is no good for code that uses API calls for a platform.  {$ifdef option_1}opt_t:=1;{$endif}  {$ifdef option_2}opt_t:=2;{$endif}  {$ifdef option_3}opt_t:=3;{$endif}   oneofmyintegers:=set_integer(0,2,4,8);   end;

Navigation

[0] Message Index

[#] Next page

Go to full version