Preprocessor directives

Hi all

I want to know if AND or OR operatrions are possible on the preprocessor directives?

I followed http://docs.blackberry.com/en/developers/deliverables/21065/Specifying_preprocessor_directives_65763... but it does not mention anything for this.

Laughing out loud
You can use ifdef and ifndef AFAIK.

Tags: BlackBerry Developers

Similar Questions

  • CVI2013 f1 and preprocessor # directive

    CVI2013 with f1 gives error of generation of preprocessor # directive (token concatenation).

    See attachment

    You incorrectly use the # operator.

    The # operator is also called 'token paste operator', and its purpose is to tell the C preprocessor to concatenate two chips.

    You just want to concatenate two strings: you don't need any special operator:

    #define LocalDir   "E:\\"  SharedDir        // define
    
  • For JDE preprocessor directives

    Mike Kirkup briefly discussed the addition of the the CAP compiler preprocessor directives during one of his presentations.

    Although I've taken notes, I don't have enough information from its presentation to get this working. Worse, part of Mike in the game of slides in this presentation (B08) not validated.

    What we are trying to do is put up a statement of 'set' and use #ifdef / #else / #endif to the compilation conditional effect.

    Can guys RIM tell us some more detailed information?

    Try to put the ' / / #preprocess ' line of the first line of the source file.  It seems that place elsewhere in the file is not invoke the pre-treatment.

  • How do you define the preprocessor directives?

    I tried to define directives of preprocessor everywhere I can set variable custom in settings of project... nothing helps. Is it still possible? Why is this so hard to do in Momentics base surgery?

    Under a normal Eclipse C++ environment, I believe that this is in settings/generation C/C++, but this area is totally different in Momentics.

    Hello, I do not know if you are using a file .pro do or do do, but you can add it to either using one the

    D {PREPROCESSORNAME} option. For example - DUSEOPENSSL.

    For example with a .pro file you would add

    QMAKE_CXXFLAGS + +=-DUSEOPENSSL

    clean and regenerate then

    See you soon

    Swann

  • How detect you whether release or debug using compiler preprocessor directives?

    Hi - I want to detect if the user has set the ICB to compile standard as a release or a debug code during compilation.  Are there simple preprocessor conditionals to test this?

    Thank you

    Gareth

    Hey Gareth.

    The predefined macro _CVI_DEBUG_ will be defined for debug builds.  "" You can see the list of all macros predefined by going to Options "Compiler Options" Predefined Macros.

    NickB

    National Instruments

  • Multiple directives of preprocessor for d

    Hello

    I is currently working with the preprocessor directives and was able to use it successfully for my sample application. I use the Blackberry Java plug-in for Eclipse for my development and noted that it provides some guidelines predefined for all d (I work with JDE 5.0, 6.0, 7.0, and 7.1) I understand that each preprocessor can correspond to a single JDE only, I want to use a single preprocessor for multiple d statement.

    For example instead of:

    //#ifdef BlackBerrySDK6.0.0
            setTitle( "HelloBlackBerry 6.0.0" );
     //#endif
    

    I want to put a preprocessor that works for JDE 6.0.0 and all d above 6.0.0:

    //#ifdef BlackBerrySDK6.0.0 or BlackBerrySDK7.0.0 or BlackBerrySDK7.1.0
            setTitle( "HelloBlackBerry" );
     //#endif
    

    In short, I have logic AND | Operations between the preprocessor directives OR?

    Any help will be very appreciated!

    Thank you.

    I thought about it, probably using the | and & works of operators:

    //#ifdef BlackBerrySDK6.0.0 | BlackBerrySDK7.0.0
    do something
    //#endif
    

    Although I am amazed how none of the many articles on the preprocessor directives mention about this!

  • Add pre directive processor use of programming

    Hello

    I'm new to the blackberry development. I need to add the directive of preprocessor to build according to the version of the OS. I wrote a logic to get a version of the OS and its very good operation, but the problem is that I'm not able to add the preprocessor directive when running.

    Thanks in advance.

    Coralie

    I think you're confused about what you can do with the preprocessor directives.  These preprocessor directives are designed to tell the compiler what to do.  If during execution, once it has been compiled, it is too late to do anything with the preprocessor directives!

    These directives are normally used to generate different versions for different environments, these different versions to different levels of the BONE.  You must do it at compile time.  If you include OS 7.0 a specific encoding in your cod so it will not work on an older operating system, even if this piece of code is never used.

    In any case, can you think of your question a bit more.  Maybe you can ask the question another way.

  • _WIN32_IE different value in 2009 of the CVI and CVI 2010

    Hello everyone, I have a special problem, that I have not experienced before. I hope that I'm not the first person to deal with this problem...

    I have a code written and properly compiled in 2009 CVI source and just trying to compile it in CVI 2010 as it is, until I make my changes. The problem is that, in 2010, the NM_CUSTOMDRAW defined in CommCtrl.h (and other things used in the source code) (see below) is not found by the pre-procesor because _WIN32_IE value is not the same as in 2009 of the CVI. I wonder if this _WIN32_IE is set by the compiler itself. I tried to change it in the Build-> Configuration-> Manage configuration-> Edit-> Build options-> compiler sets by adding the /D_WIN32_IE sentence = 0 x 0300, but then the compiler says "ilegal expresion" at the first time, it takes the value _WIN32_IE in ShellAPI.h. I have the same error in compilation for 64 and 32.

    Suggestions please!

    CommCtrl.h

    ...

    #if (_WIN32_IE > = 0 x 0300)
    #define NM_CUSTOMDRAW (NM_FIRST-12)

    ...

    Josete Hello,

    Which is the line which gives you errors? Is it in your code or in a headder file? NM_CUSTOMDRAW use in your code?

    / D_WIN32_IE = 0 x 0300 in the compiler sets should work. What is the line that gives you an error in ShellAPI.h?

    Could you please list the headers you include in a file that gives you an error.

    To understand how the preprocessor directives are expanded, you can use the menu Options-> pre-treatment of Source files from a window of the source editor.

    Constantin

  • CVI2010-operator sizeof returns an incorrect size of a struct

    Hello

    in CVI2010 the sizeof operator returns an incorrect struct size if it contains 4 bytes and other spaces. I guess that the addresses in the struct are also not as c-programmer thinks. First a minimalist code example:

    typedef struct
    {
    oneByte tank;
    long fourByte;
    } TestStruct;

    main void)
    {
    int size;
    TestStruct tmpVar;
    size = sizeof (TestStruct);
    Here are the dimensions = 8 instead of 5

    }

    Over the past years and last cvi-versions I had never compiled with the compiler Borland, which returns the correct size. Because the Borland compiler is not included in CVI 2010, I am using the compiler to build-in the standard. In my opinion, the compiler looks to optimize the code somehow, my project cannot work with.

    Because I read the direct struct of binary files I'm looking for a to code based, solution.

    Is it possible to disable the relevant optimization?

    Thanks for your help and your response.

    Markus

    The compiler may have different alignments for the fields of the struct: a usual behavior is to them be aligned on a 4 byte boundary, that is each field starts on a multiple of 4 bytes from the beginning of the structure in memory. This seems to be the behavior of the compiler that you are using currently, who returns as the size of the structure 8 after aligning the fields.

    Alignment of the structure can be modified with a #pragma appropriate preprocessor directive: adding #pragma pack (1); in your code tells the compiler to pack the structure without filler fields; After that this statement sizeof returns the size 5-bytes are waiting for you.

  • How to specify the JRE (component Pack)

    When I created my project, he asked me what JRE to use and I said 4.6.  Now, I want to change to 4.5 (and change to my taste and so forth).  When I go to "Windows-> preferences-> Java-> Installed JREs", I can see all the components, as I should, and I can choose what I want, which makes it the default for newly created projects.  When I right click on my project and go to 'Properties-> Blackberry project-> View/Edit Application Descriptor', there are all my JREs (and so I guess these are the component packs) under the heading "Preprocessor Directives", which doesn't seem to have anything to do with JRE or component.  In addition, they are all greyed out and I can't select another than one marked 'BlackBerrySDK4.6.0', even if I can see all others grayed.

    I'm in the right place to change the JRE/component Pack I want to build for and, if so, how do the selections not gray?

    Or, if not, is there a file I can edit somewhere that tells what JRE to use Eclipse/Blackberry?

    Thank you

    Allen

    You should see JRE System Library in your project in your package Explorer.

    Right-click it, and then click Properties to change your target OS.

    The preprocessor directives change each time you change the JRE to use preprocessor to strip the code that is not compatible with a certain operating system.

  • Problem with the conversion of Midlet (jad/jar) cod file (Jasymca 2.0)

    BB Storm last official OS.

    There is this wonderful program called Jasymca 2.0 which is a combination of programs of mathematics MATLAB and MAXIMA of high-end (subset to fit) and written in J2ME as a MOPED. To see a demo of it, go to http://webuser.fh-furtwangen.de/~dersch/jasymca2/indexEN.html and click on demo on the left. It's quite impressive... able to make the symbolic math and math matrix among others. The ultimate calculator for a PDA... and the best I could find out there.

    The only problem is that it is written in J2ME as a MIDLET and the runtime is stored as a combination of jad/jar. Now, I tried the standard conversion using the CAP as follows...

    CAP import = "C:\Program Research In Motion\BlackBerry JDE 4.7.0\lib\net_rim_api.jar" code name is jasymca-midlet jad is Jasymca.jad Jasymca.jar

    It seems to work very well. There are a few warnings about unused variables, but that's fine. The last line was "No Errors".

    .. .and he left me with a file .cod 229K

    When I insert it in my blackberry through javaloader, it loads very well.

    However, when I look in my download directory I 2 files related to Jasymca and not running.

    I suspect that it is because the cod file is too big. Is there another step I can do for the cod of the loadable file?

    Any help is appreciated.

    Thank you

    -Donald

    It takes more time than I expected.

    There is a preprocessor directives in the source files and to leave JDE to understand these guidelines, I need to modify the jdp.

    I stopped the investigation

    But I will say that I found.

    icons and data files must be located in the default folder.

    If the root folder of the package is src\

    path of the icon should be: src\myicon.png

    for now the icons are located in the src\icons folder

    in this case the image files are not accessible from the BlackBerry App.

    The second: there are some files showed up as the symbol file name first.

    JDE does not add these files to the project.

    I think that the best way would be to contact the developer of Jasymca and talking to him about the Jasymca and porting for BlackBerry

  • Targeting different versions of the operating system with the same code

    Hello again,

    I'm looking to use some features of the OS 5.0 such as the transitional API.  Is there sort of having a base code that will compile in different versions of the JDE, but exclude the code blocks if the OS does not meet the requirements?

    For example, transitions on a device to OS 5.0 but not appear on device OS 4.5.

    Ideally, I'm looking for a solution that would integrate directly with Eclipse and debug without any extra steps in the two versions of the operating system.

    Try to do research on the "preprocessor directives", you can use this to do what you need.

    Basically, you wrap the code OS 5.0 in the guidelines such as:

    #ifdef VER_5
    System.out.println ("This compile for 5.0");
    #else
    System.out.println ("This compiles for no 5.0");
    #endif

    Then, enable you or disable directives in the compiler generate COD versions for each platform.

    Jason

    www.lcamobile.com

  • How dynamically invoke or avoid the API methods depending on the Version of the API?

    Searched but could not find guides on this...

    I have a JDK 4.6 App, which itself pretties by using the () calls Field.setBackground and BackgroundFactory.Since that they require a minimum of JDK 4.6 it don't works on JDK 4.6 or better devices.

    It is just appearance, the rest of the application requires JDK 4.1. Is anyway I can avoid loading classes and 4.6 calls if the environment is< jdk="">

    I would use reflection except that is is not compatible with the Blackberry. I really want to avoid the separate binary files.

    Thanks - Lindsay

    I tried the preprocessor directives.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=8277

  • ExtendScript debugging with photoshop? is this possible?

    Just start using ExtendScript (v3.8.0.12) to write a script for Photoshop CS6.

    When I run the script in ExtendScript I an error "result: undefined" when I touched the first line of code that references the file currently open in Photoshop.  for example "var Name = app.activeDocument. name.replace (/ \.)" [ ^\.] +$/, ''); "

    Question - is there a way to "target" my photoshop runnining instance so when you debug in ExtendScript is using it?

    There is a dropdownlist control in the upper left of the ESTK window where you can define the target application. Or you can add the target photoshop #target preprocessor directive to the script.

  • ttclasses connect timesten11g fatal error

    Hi Chris
    I run a simple ttclasses program core dump in timesten11g. But the program is OK in timesten7.0. The new ttversion is: TimesTen release 11.2.1.8.0 (64-bit Aix) (tt1121:53388) 2011-02 - 02 T 06: 01:49Z.
    The problem is too urgent for us to update the timesten. We holp a quick response on your part, thank you very much.
    Best wishes.

    My program is the following:
    #include < ttclasses/TTConnection.h >
    #include < ttclasses/TTStatus.h >
    #include < ttclasses/TTCmd.h >
    #include < unistd.h >

    int Conn (conn, TTStatus, TTConnection & tt_stat);
    int main (int argc, char * argv [])
    {
    TTConnection conn1.
    TTStatus stat (TTStatus::DO_NOT_THROW).
    int ret = Conn (conn1, stat);

    return 0;
    }

    int Conn (conn, TTStatus, TTConnection & tt_stat)
    {
    printf ("hhh\n");
    Conn. Connect("DSN=TT11","liangxiu","123",tt_stat);
    printf ("zzzz\n");
    If (tt_stat.rc! = SQL_SUCCESS)
    {
    printf ("TTError--:%s\n", tt_stat.err_msg);
    Returns - 1;
    }
    printf ("connect success\n");
    Conn. Disconnect (tt_stat);
    return 0;
    }

    Hi Grace,

    I still would like the information I asked for, but I think I know what the issue is here. From Timesten 11.2.1.6.1, TTClasses is always constructed with exceptions enabled and so a little against documentation, applications that use the TTClasses must include - DTTEXCEPT as the same compiler if preprocessor directive the application code does not use exceptions.

    Can you please try compilations/links in your application to test as follows:

    xlC_r - g - q64 - DTTEXCEPT - i/cdr1/home/tt11/TimesTen/tt1121/include-L/cdr1/home/tt11/TimesTen/tt1121/lib - o conntest conntest.cpp lttclasses

    and see if that fixes the problem.

    Thank you

    Chris

Maybe you are looking for