VS2010 Predefined Macros

Visual Studio 预定义宏 解决方案和项目目录相关宏:解决方案文件(.sln)所在的目录。:解决方案文件的完整路径。:解决方案文件的名称。:解决方案的名称(不包括扩展名)。:项目文件(.vcxproj)所在的目录。:项目文件的完整路径。:项目文件的名称。:项目的名称(不包括扩展名)。输出目录和文件相关宏$(OutDir):输出目录,通常是bin或build目录。$(IntDir):中间目录,通常是obj目录,用于存放中间文件(如对象文件)。:目标目录,即最终生成的文件(如可执行文件或库文件)所在的目录。 阅读详情


Lists the predefined ANSI C and Microsoft C++ implementation macros.

The compiler recognizes predefined ANSI C macros and the Microsoft C++ implementation provides several more. These macros take no arguments and cannot be redefined. Some of the predefined macros listed below are defined with multiple values. See the following tables for more information.

ANSI-Compliant Predefined Macros

Macro

Description

__DATE__

The compilation date of the current source file. The date is a string literal of the form Mmm dd yyyy. The month name Mmm is the same as for dates generated by the library function asctime declared in TIME.H.

__FILE__

The name of the current source file. __FILE__ expands to a string surrounded by double quotation marks. To ensure that the full path to the file is displayed, use /FC (Full Path of Source Code File in Diagnostics).

__LINE__

The line number in the current source file. The line number is a decimal integer constant. It can be changed with a #line directive.

__STDC__

Indicates full conformance with the ANSI C standard. Defined as the integer constant 1 only if the /Za compiler option is given and you are not compiling C++ code; otherwise is undefined.

__TIME__

The most recent compilation time of the current source file. The time is a string literal of the form hh:mm:ss.

__TIMESTAMP__

The date and time of the last modification of the current source file, expressed as a string literal in the form Ddd Mmm Date hh:mm:ss yyyy, where Ddd is the abbreviated day of the week and Date is an integer from 1 to 31.

Microsoft-Specific Predefined Macros

Macro

Description

_ATL_VER

Defines the ATL version.

In Visual Studio 2010, _ATL_VER is defined as 0x0A00.

_CHAR_UNSIGNED

Default char type is unsigned. Defined when /J is specified.

__CLR_VER

Defines the version of the common language runtime used when the application was compiled. The value returned will be in the following format:

Mmmbbbbb

where,

  • M is the major version of the runtime

  • mm is the minor version of the runtime

  • bbbbb is the build number.

// clr_ver.cpp
// compile with: /clr
using namespace System;
int main() {
   Console::WriteLine(__CLR_VER);
}

__cplusplus_cli

Defined when you compile with /clr, /clr:pure, or /clr:safe. Value of __cplusplus_cli is 200406. __cplusplus_cli is in effect throughout the translation unit.

// cplusplus_cli.cpp
// compile with: /clr
#include "stdio.h"
int main() {
   #ifdef __cplusplus_cli
      printf("%d\n", __cplusplus_cli);
   #else
      printf("not defined\n");
   #endif
}

__COUNTER__

Expands to an integer starting with 0 and incrementing by 1 every time it is used in a source file or included headers of the source file.__COUNTER__ remembers its state when you use precompiled headers.

The following example uses __COUNTER__ to assign unique identifiers to three different objects of the same type.

First, assume the following class definition. The constructor takes an integer as a parameter.

C++
// initialize object with a read-only unique ID
exampleClass::exampleClass(int nID)
{
	m_nID = nID;
}

int exampleClass::GetID()
{
	return m_nID;
}


In main, the application declares three objects of type exampleClass, using __COUNTER__ as the unique identifier parameter.

C++
// Demonstration of __COUNTER__, assigns unique identifiers to
//  different objects of the same type
int main(int argc, char** argv)
{
	// __COUNTER__ is initially defined as 0
	exampleClass e1(__COUNTER__);

	// having been referenced, __COUNTER__ is now defined as 1
	exampleClass e2(__COUNTER__);

	// __COUNTER__ is now defined as 2
	exampleClass e3(__COUNTER__);

	printf("e1 ID: %i\n", e1.GetID());
	printf("e2 ID: %i\n", e2.GetID());
	printf("e3 ID: %i\n", e3.GetID());

	// Output
	// ------------------------------
	// e1 ID: 0
	// e2 ID: 1
	// e3 ID: 2

	return 0;
}


__cplusplus

Defined for C++ programs only.

_CPPRTTI

Defined for code compiled with /GR (Enable Run-Time Type Information).

_CPPUNWIND

Defined for code compiled with /GX (Enable Exception Handling).

_DEBUG

Defined when you compile with /LDd, /MDd, and /MTd.

_DLL

Defined when /MD or /MDd (Multithreaded DLL) is specified.

__FUNCDNAME__

Valid only in a function. Defines the decorated name of the enclosing function as a string.

__FUNCDNAME__ is not expanded if you use the /EP or /P compiler option.

The following example uses the __FUNCDNAME__, __FUNCSIG__, and __FUNCTION__ macros to display function information.

C++
// Demonstrates functionality of __FUNCTION__, __FUNCDNAME__, and __FUNCSIG__ macros
void exampleFunction()
{
	printf("Function name: %s\n", __FUNCTION__);
	printf("Decorated function name: %s\n", __FUNCDNAME__);
	printf("Function signature: %s\n", __FUNCSIG__);
	
	// Sample Output
	// -------------------------------------------------
	// Function name: exampleFunction
	// Decorated function name: ?exampleFunction@@YAXXZ
	// Function signature: void __cdecl exampleFunction(void)
}


__FUNCSIG__

Valid only in a function. Defines the signature of the enclosing function as a string.

__FUNCSIG__ is not expanded if you use the /EP or /P compiler option.

On a 64-bit operating system, the calling convention is __cdecl by default.

See __FUNCDNAME__ for an example.

__FUNCTION__

Valid only in a function. Defines the undecorated name of the enclosing function as a string.

__FUNCTION__ is not expanded if you use the /EP or /P compiler option.

See __FUNCDNAME__ for an example.

_INTEGRAL_MAX_BITS

Reports the maximum size (in bits) for an integral type.

// integral_max_bits.cpp
#include <stdio.h>
int main() {
   printf("%d\n", _INTEGRAL_MAX_BITS);
}

_M_ALPHA

Defined for DEC ALPHA platforms (no longer supported).

_M_AMD64

Defined for x64 processors.

_M_CEE

Defined for a compilation that uses any form of /clr (/clr:oldSyntax, /clr:safe, for example).

_M_CEE_PURE

Defined for a compilation that uses /clr:pure.

_M_CEE_SAFE

Defined for a compilation that uses /clr:safe.

_M_IX86

Defined for x86 processors. See the Values for _M_IX86 table below for more information. This is not defined for x64 processors.

_M_IA64

Defined for Itanium Processor Family 64-bit processors.

_M_IX86_FP

Expands to a value indicating which /arch compiler option was used:

_M_MPPC

Defined for Power Macintosh platforms (no longer supported).

_M_MRX000

Defined for MIPS platforms (no longer supported).

_M_PPC

Defined for PowerPC platforms (no longer supported).

_M_X64

Defined for x64 processors.

_MANAGED

Defined to be 1 when /clr is specified.

_MFC_VER

Defines the MFC version. For example, in Visual Studio 2010, _MFC_VER is defined as 0x0A00.

_MSC_BUILD

Evaluates to the revision number component of the compiler's version number. The revision number is the fourth component of the period-delimited version number. For example, if the version number of the Visual C++ compiler is 15.00.20706.01, the _MSC_BUILDmacro evaluates to 1.

_MSC_EXTENSIONS

This macro is defined when you compile with the /Ze compiler option (the default). Its value, when defined, is 1.

_MSC_FULL_VER

Evaluates to the major, minor, and build number components of the compiler's version number. The major number is the first component of the period-delimited version number, the minor number is the second component, and the build number is the third component. For example, if the version number of the Visual C++ compiler is 15.00.20706.01, the _MSC_FULL_VER macro evaluates to 150020706. Type cl /? at the command line to view the compiler's version number.

_MSC_VER

Evaluates to the major and minor number components of the compiler's version number. The major number is the first component of the period-delimited version number and the minor number is the second component.

For example, if the version number of the Visual C++ compiler is 15.00.20706.01, the _MSC_VER macro evaluates to 1500.

In Visual Studio 2010, _MSC_VER is defined as 1600.

__MSVC_RUNTIME_CHECKS

Defined when one of the /RTC compiler options is specified.

_MT

Defined when /MD or /MDd (Multithreaded DLL) or /MT or /MTd (Multithreaded) is specified.

_NATIVE_WCHAR_T_DEFINED

Defined when /Zc:wchar_t is used.

_OPENMP

Defined when compiling with /openmp, returns an integer representing the date of the OpenMP specification implemented by Visual C++.

// _OPENMP_dir.cpp
// compile with: /openmp 
#include <stdio.h> 
int main() {
   printf("%d\n", _OPENMP);
}

_VC_NODEFAULTLIB

Defined when /Zl is used; see /Zl (Omit Default Library Name) for more information.

_WCHAR_T_DEFINED

Defined when /Zc:wchar_t is used or if wchar_t is defined in a system header file included in your project.

_WIN32

Defined for applications for Win32 and Win64. Always defined.

_WIN64

Defined for applications for Win64.

_Wp64

Defined when specifying /Wp64.

As shown in following table, the compiler generates a value for the preprocessor identifiers that reflect the processor option specified.

Values for _M_IX86

Option in Development Environment

Command-Line Option

Resulting Value

Blend

/GB

_M_IX86 = 600 (Default. Future compilers will emit a different value to reflect the dominant processor.)

Pentium

/G5

_M_IX86 = 500

Pentium Pro, Pentium II, and Pentium III

/G6

_M_IX86 = 600

80386

/G3

_M_IX86 = 300

80486

/G4

_M_IX86 = 400




注:本文转载自:http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.100).aspx


本地部署大模型框架 LMStudio和Ollama+WebUI对比 之前我们的辣妈系列文章介绍了很多如何使用Ollama框架+OpenWebUI做很多大模型框架下相关的事情。之后我们也尝试了LMStudio这样一体化的工具。本文介绍下LMStudio 和 Ollama+Web UI 各有优劣,具体选择取决于你的需求。 阅读详情

相关推荐

COMSOL报错调试总结(不定期更新)

COMSOL报错调试总结1. 可定位错误1.1 除零错误1.2 未定义变量值1.3 边界条件/材料属性等缺失2. 难定位错误2.1. 装配期间内存不足 官方给的案例总是非常完美,运行流畅,结果完美。但是自己做模型时候就总是报错,而且不像自己coding的程序那样可以明确定位哪里出了bug。这里把我碰到的一些报错问题以及调试方法记录下来~ 部分来源于以下参考来源: http://wap.sciencenet.cn/blog-1467490-1118453.html?mobile=1 1. 可定位错误 以下错误

jessica0307的博客 8万+

vscode添加预编译宏定义

预定义宏 xxx ,使 #ifdef xxx 后的代码块能够高亮,而#ifndef xxx 后的代码块变暗预定义宏 xxx ,使得实际运行的代码识别到 xxx已宏定义,即 xxx=1两种有本质区别,简要地说,第一种改变vscode的配置解析文件,第二种直接作用于编译器。以gcc为例gcc -Dxxxx 相当于 C 语言中的 #define xxxx这里是将 file 文件的宏, 扩展到 gcc/g++ 的输入文件, 宏定义本身并不出现在输入文件中。

BaLa_Boom的博客 9238

bcftools学习笔记(一)

欢迎关注"生信修炼手册"!本篇主要介绍index, view, query, sort, reheader这五个命令。1. indexindex命令用于对VCF文件建立索...

庐州月光的博客 6016

VS Code添加自定义宏

c_cpp_properties.json文件一般在项目根目录的.vscode目录下,如果没有这个文件,则需要生成,可以通过Ctrl+Shift+p快捷键调出命令面板,输入:【C/C++:编辑配置(JSON)】或英文版下输入【C/C++:Edit Configurations(JSON)】创建并打开c_cpp_properties.json。

K0000000r的专栏 2832

SQL 通过sum() over(order by ,rownum)实现财务现金日记账实例

SELECT 类型,to_char(发生日期,'yyyy-MM-dd') 发生日期,期初余额,借方金额,贷方金额, (CASE WHEN 借方金额>0 THEN '借' WHEN 贷方金额>0 THEN '贷' ELSE '平' END) 方向, sum(收支金额) over(order by 发生日期, rownum) 余额 FROM( SELECT LX 类型,账户,账号,摘要,发生日期,单据ID, ...

qq_41451794的博客 1026

Python爬虫实战:使用Scrapy+Playwright高效获取电力市场数据

本文将详细介绍如何使用Python构建一个高效的电力市场数据爬虫系统。我们将结合Scrapy框架和Playwright浏览器自动化工具,解决电力市场网站常见的反爬机制,实现数据的稳定抓取。文章包含完整的项目搭建流程、代码实现、数据处理方案以及部署建议,帮助读者掌握现代爬虫开发的核心技术。关键词:Python爬虫、Scrapy、Playwright、电力市场、数据采集、反爬对策python复制下载# 基本字段region = scrapy.Field() # 区域。

2201_76125261的博客 1887

python value out of range_ValueError:day日期时间超出范围

I have run into a problem with some code I have been writing. I take in four inputs ( day, month and year ) as a date, and times for how many times they want to repeat the task ( eg. every Monday for...

weixin_39625709的博客 2504

蓝牙攻防实战:蓝牙技术详解

蓝牙作为轻量级、低功耗的无线通信技术,其设计兼顾了效率与灵活性,但也留下了诸多安全隐患。随着物联网设备的爆发式增长,蓝牙的攻击面也在不断扩大。理解其底层通信机制、协议栈结构以及配对加密逻辑,是提升无线安全防护能力的关键。

idlecloud0105的博客 749

数值的溢出问题

Java数值转换遇到的问题

weixin_65502337的博客 314

【CANoe】CAPL_ECU上电后首帧报文发出时间检测

【CANoe】CAPL_ECU上电后首帧报文发出时间检测,通过CANoe I/O口检测电压实现

星Yeah 的博客 2527

第1章 大数据概述

三次信息化浪潮 信息化浪潮 发生时间 标志 解决的问题 代表企业 第一次 1980年前后 个人计算机 信息处理 Intel、AMD、IBM、苹果、微软、联想、戴尔、惠普等 第二次 1995年前后 互联网 信息传输

wyz191的专栏 7091

mysql异常Out of range value for column 'persontimes'

Data truncation: Out of range value for column ‘persontimes’ at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column ‘persontimes’ at row ...

ByteX的博客 4868

(王道计算机组成原理)第二章数据的表示和运算-第三节:运算方法和运算电路 1(基本运算部件)

本文主要介绍了计算机组成原理中的加法器和算术逻辑单元(ALU)的基本概念与实现原理。首先,文章详细讲解了一位全加器的工作原理,包括其输入输出、逻辑表达式及真值表。接着,介绍了并行加法器的两种类型:串行进位和并行进位的加法器,分析了它们的优缺点。随后,文章探讨了带标志位的加法器,说明了如何通过标志位生成逻辑来判断加法结果的状态。最后,文章阐述了ALU的功能及其实现原理,包括ALU的基本结构、控制信号的作用以及在实际考试中的图示表示。通过这些内容,读者可以全面了解加法器和ALU在计算机中的重要作用及其工作原理。

快乐江湖的博客 3844

Predefined Macros

原文地址:http://msdn.microsoft.com/zh-cn/library/b0084kay(v=vs.100).aspx Updated: October 2010 Lists the predefined ANSI C and Microsoft C++ implementation macros. The compiler recogn

xiaogugood的专栏 884

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

mysql保存数据提示:Out of range value for column错误

mysql保存数据提示:Out of range value for column错误

CAI____NIAO的博客 1184

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

C++中的宏定义与MFC中的预处理器

一、C++中的宏定义 C/C++编译系统编译程序的过程为预处理、编译、链接。预处理器是在程序源文件被编译之前根据预处理指令对程序源文件进行处理的程序。预处理器指令以#号开头标识,末尾不包含分号。预处理命令不是C/C++语言本身的组成部分,不能直接对它们进行编译和链接。C/C++语言的一个重要功能是可以使用预处理指令和具有预处理的功能。C/C++提供的预处理功能主要有文件包含、宏替换、条件编译等。...

qq_16334327的博客 2186

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【工具使用】VSCODE 配置#define

使用VSCODE开发项目的时候,经常会遇到宏定义包含的数据是暗的,导致代码查看遇到阻碍。那么如何在Vscode里设置#define宏呢? 往下看: 在Vscode里设置#define宏的 步骤如下: 1、按键ctrl+shift+p,打开如下图 2、然后打开文件如下图 3、如上图填写自己的#define 即可,保存。 然后去项目中去查看。 ...

NBDR_YL的博客 5194

VS中添加预处理宏的方法 + 预处理器的预定义宏大全

VS中添加预处理宏的方法 原文地址:https://www.cnblogs.com/rainbow70626/p/6417928.html 除了在.c及.h中添加宏定义之外,还可以采用如下方法添加宏定义: 1、若只需要定义一个宏(如#define DEBUG),可以右键点击工程-->属性-->c/c++-->预处理器-->预处理器定义,点击下拉框中的编辑,输入想要定义...

weixin_41796049的博客 1万+

预处理详解

预处理详解

2402_87779153的博客 1079

VS2017 添加预定义宏

project_name[right click] -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions -> 添加一行TEST_DEFINE_STRING="bla-bla-bla" 转载于:https://www.cnblogs.com/xbit/p/9391748.html...

weixin_30888413的博客 4693

使用宏区别不同的VS和C++标准的版本

__cplusplus__cplusplus(_MSVC_LANG) __cplusplus(_MSVC_LANG) 区别是C++还是C,C中没有定义这个宏 #include <stdio.h> int main() { #ifndef __cplusplus printf("C program.\n"); #else printf("C++ program.\n"); #endif return 0; } 程序在C和C++兼容,编译出的C目标文件和C++目标文

qq_34552942的博客 2609

vscode添加宏定义

在vscode中添加编译时的宏定义,使可以同步高亮显示代码块。

What the Fuck 2387

vscode 添加全局宏定义

问题: 利用vscode编辑代码时,设置了禁用非活动区域着色后,在一些编译脚本中配置的宏又识别不了 遇到#ifdef包住的代码就会变暗色,想查看代码不是很方便。如下图: 解决: 在vscode中添加全局宏定义。 步骤: 1.ctrl+shift+p,选择对应的编辑配置,比如c/c++的,进入文件c_cpp_properties.json 2.在配置文件中的defines项中加入需要的宏定义 ...

YxiaoqiR的博客 2万+

初探VS2010中的Profile(性能剖析)功能

VS2010中的Profile(性能剖析)功能十分实用,它可以协助程序员迅速锁定当前程序的性能瓶颈,为程序的优化做准备。 点击VS2010的Analyze菜单,选择Launch Performance Wizard,依照提示可以很方便地完成Profile的必需配置。可能你会碰到"Injection of runtime library failed"错误,这时就不要使用Wizard,而要选择

ddxkjddx的专栏 2460

查看编译器预定义的宏

一、看gcc的: 1、新建一个空的相应文件 touch t.c 2、查看 [zzz@localhost test]$ arm-hisiv300-linux-gcc -E -dM t2.c  #define __DBL_MIN_EXP__ (-1021) #define __HQ_FBIT__ 15 #define __UINT_LEAST16_MAX__ 65535 #define

brightming的专栏 3153
上一篇: Microsoft VS2008 MFC 与 BCGControlBar 的区别
下一篇: 在 VC6.0 下设置 Unicode 编译环境
DavidHsing
博客等级 码龄19年 782粉丝 127原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值