Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check for ARC in precompile

I have an iOS refactoring library that I want to work with and without the ARC compilation option. Is there a way to detect during compilation, like with an #ifdef, if ARC is available?

like image 527
Peter DeWeese Avatar asked Oct 10 '11 03:10

Peter DeWeese


People also ask

Where is the precompiler located?

The location of the precompiler differs from system to system. The system or database administrator usually defines logicals or aliases, or uses other system-specific means to make the Pro*C/C++ executable accessible. The INAME= argument specifies the source file to be precompiled. For example, the command

How to use precompiler in Pro*C/C++?

whether Pro*C/C++ parses (with a C parser) the .pc source. directory where system header files, such as iostream.h, are found You can enter any precompiler option in the command line. Many can also be entered inline in the precompiler program source file, using the EXEC ORACLE OPTION statement.

What does the precompile command do?

The PRECOMPILE command processes an application program source file containing embedded SQL statements. A modified source file is produced, containing host language calls for the SQL statements and, by default, a package is created in the database. This command can be issued from any database partition in db2nodes.cfg.

How does the precompile process report errors?

Any errors found are reported at precompile time. The precompiler gets information needed for a semantic check by using embedded DECLARE TABLE statements, or if you specify the USERID option on the command line, by connecting to Oracle and accessing the data dictionary.


1 Answers

Yes, you can use the following:

#if __has_feature(objc_arc)   ... #endif 

Even if you're using the latest version of LLVM, this will only evaluate to true if you're compiling with the -fobjc-arc option.

like image 60
Dave DeLong Avatar answered Sep 20 '22 14:09

Dave DeLong