本文介绍了预定义常量,预处理器指令等...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以找到所有内置预定义常量的列表.在开发和分发代码时,生成可重用的代码是适当的,但是,并不是每个人都使用相同的编译器.一些使用VS 2005,一些使用2008,其他使用Express版本,其他可能仍使用#Develop开源IDE.我正在寻找应该应该存在的预定义常量,这些常量可以让我将某些代码节保留为特定的版本.

应该有一个预处理程序定义,可以让程序员知道编译器的版本,例如 #if VS2005

#elif VS2008

#endif

甚至更好的版本是确定要编写代码的Framework的版本编译下.尽管.Net框架非常有用,但有时我只想重用代码,而不链接到先前生成的程序集.因此,我可以编写一些适用于2.0、3.0、3.5等的代码,以便在编译我链接到12个不同项目中的一个文件时,它会根据项目的框架等进行编译.



Where can I find a list of all the built-in pre-defined constants.  When developing code and distributing it, it is appropriate to generate reusable code, however, not everyone uses the same compiler.  Some use VS 2005, some are using 2008, others are using Express editions, others still may be using #Develop open source IDE.  I'm looking to find the predefined constants that should exist that would allow me to taylor some code sections to the specific versions.

There should be a preprocessor define that lets the programmer know the version of the compiler, like
#if VS2005

#elif VS2008

#endif

or even better would be one to determine the Framework the code is being compiled under.  As much as the .Net framework is very helpful, there are times when I just want to reuse code, not link to a previously generated assembly.  thus, i could write some code to work for 2.0, 3.0, 3.5, etc so when that one file that I link to in 12 different projects is compiled, it is compiled according to the framework of the project, etc. 

many IDE's have these built in pre-processor defines that are automatic so code can be written more distributable.  Where can I find the list of such items for VC/VB.

Thanks.

Jaeden "Sifo Dyas" al'Raec Ruiner




推荐答案


这篇关于预定义常量,预处理器指令等...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 18:13
查看更多