Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Conditional compiling for 32/64 bits

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Conditional compiling for 32/64 bits

    Dear experts!
    I can see from different posts that preprocessor directives can be used in NT8 indicators. Is it possible to make conditional compiling depending of 32/64 bits platform?
    Something similar to the below part of the code:
    Code:
    [StructLayout(LayoutKind.Explicit,Size = 12)]
    	public struct My Data
    		{
    		 FieldOffset(0)]	public	int			iCode;		 		
    		 FieldOffset(4)]	public	IntPtr			szName;
    	#if NT8_32 									
    		 FieldOffset(8)]	public	int			iReserved;
    	#endif
    		}
    If answer is “yes”, what could be the directive in #if statement. If answer is "no" any suggestion about the ways to achieve similar result

    Thank you in advance
    GmA

    #2
    Hello gma17,

    Thanks for opening the thread.

    There are not any supported preprocessor directives that I know of that can identify a 64bit compile from a 32bit compile.

    I could submit a feature request on your behalf to request to have supported preprocessor directives for 32 bit and 64 bit compiles if it interests you.

    If that is the case, please let me know.

    Comment


      #3
      Helo Jim!

      Thank you for the fast reply.
      Well, It could be a good feature in the future, but I'll need to find another solution.

      With kind regards
      GmA

      Comment


        #4
        Hello gma17,

        As a thought, you could place this in a separate namespace and include that namespace depending on the version of the script you are working on. This wouldn't be as 'seamless' as having the code indeffed, but it could lead you in a way where you can cleanly separate code from different versions of the script.

        Our colleague Chelsea has posted an example of how an AddOn can be used for general use methods and variables.

        Chelsea's example for NT8 - http://ninjatrader.com/support/forum...104#post457104

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X