• <tfoot id='xX3U3'></tfoot>
    <legend id='xX3U3'><style id='xX3U3'><dir id='xX3U3'><q id='xX3U3'></q></dir></style></legend>

      1. <i id='xX3U3'><tr id='xX3U3'><dt id='xX3U3'><q id='xX3U3'><span id='xX3U3'><b id='xX3U3'><form id='xX3U3'><ins id='xX3U3'></ins><ul id='xX3U3'></ul><sub id='xX3U3'></sub></form><legend id='xX3U3'></legend><bdo id='xX3U3'><pre id='xX3U3'><center id='xX3U3'></center></pre></bdo></b><th id='xX3U3'></th></span></q></dt></tr></i><div id='xX3U3'><tfoot id='xX3U3'></tfoot><dl id='xX3U3'><fieldset id='xX3U3'></fieldset></dl></div>
          <bdo id='xX3U3'></bdo><ul id='xX3U3'></ul>

        <small id='xX3U3'></small><noframes id='xX3U3'>

        iPhone的汇编程序(.s)代码中的条件编译 - 如何?

        Conditional Compilation in assembler (.s) code for iPhone - how?(iPhone的汇编程序(.s)代码中的条件编译 - 如何?)

        <tfoot id='J4noq'></tfoot>
        <i id='J4noq'><tr id='J4noq'><dt id='J4noq'><q id='J4noq'><span id='J4noq'><b id='J4noq'><form id='J4noq'><ins id='J4noq'></ins><ul id='J4noq'></ul><sub id='J4noq'></sub></form><legend id='J4noq'></legend><bdo id='J4noq'><pre id='J4noq'><center id='J4noq'></center></pre></bdo></b><th id='J4noq'></th></span></q></dt></tr></i><div id='J4noq'><tfoot id='J4noq'></tfoot><dl id='J4noq'><fieldset id='J4noq'></fieldset></dl></div>

          <small id='J4noq'></small><noframes id='J4noq'>

            <tbody id='J4noq'></tbody>
              • <bdo id='J4noq'></bdo><ul id='J4noq'></ul>

                <legend id='J4noq'><style id='J4noq'><dir id='J4noq'><q id='J4noq'></q></dir></style></legend>

                • 本文介绍了iPhone的汇编程序(.s)代码中的条件编译 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have a few lines of assembler arm code in an .s file. Just a few routines i need to call. It works fine when building for the device, however when i switch to iPhone Simulator i get "no such instruction" errors. I tried to compile parts of the .s file conditionally with what i know:

                  #if !TARGET_IPHONE_SIMULATOR
                  

                  But the assembler doesn't recognize these preprocessor directives (of course) and none of the conditional compilation techniques for assembler that i could remember or find worked, so i'm scratching my head now on how to avoid compilation of that assembler code when building for the Simulator. I also don't see a project option in Xcode that would allow me to compile the file or not depending on the target platform.

                  SOLVED:

                  All i was missing was the proper #import in the assembler file. I did not think of adding it because Xcode syntax highlighted any preprocessor directive in green (comment) which made me assume that these commands are not recognized when in fact they work just fine.

                  This works:

                  #import "TargetConditionals.h"
                  
                  #if !TARGET_IPHONE_SIMULATOR
                  
                  ... asm code here ...
                  
                  #endif
                  

                  解决方案

                  You do do it with a pre-processor macro. They are defined in TargetConditionals.h TARGET_IPHONE_SIMULATOR should be there! (You do need to #include it however.)

                  这篇关于iPhone的汇编程序(.s)代码中的条件编译 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  Show UITabBar when UIViewController pushed(推送 UIViewController 时显示 UITabBar)
                • <i id='ap8Qu'><tr id='ap8Qu'><dt id='ap8Qu'><q id='ap8Qu'><span id='ap8Qu'><b id='ap8Qu'><form id='ap8Qu'><ins id='ap8Qu'></ins><ul id='ap8Qu'></ul><sub id='ap8Qu'></sub></form><legend id='ap8Qu'></legend><bdo id='ap8Qu'><pre id='ap8Qu'><center id='ap8Qu'></center></pre></bdo></b><th id='ap8Qu'></th></span></q></dt></tr></i><div id='ap8Qu'><tfoot id='ap8Qu'></tfoot><dl id='ap8Qu'><fieldset id='ap8Qu'></fieldset></dl></div>

                • <legend id='ap8Qu'><style id='ap8Qu'><dir id='ap8Qu'><q id='ap8Qu'></q></dir></style></legend>
                      • <bdo id='ap8Qu'></bdo><ul id='ap8Qu'></ul>

                            <tbody id='ap8Qu'></tbody>

                        1. <small id='ap8Qu'></small><noframes id='ap8Qu'>

                          <tfoot id='ap8Qu'></tfoot>