Basic Types in Erlang Beam Emulator

 125 /*
 126  * Make sure we have a type for FD's (used by erl_check_io)
 127  */
 128
 129 #ifndef ERTS_SYS_FD_TYPE
 130 #define ERTS_SYS_FD_INVALID ((ErtsSysFdType) -1)
 131 typedef int ErtsSysFdType;
 132 #else
 133 #ifndef ERTS_SYS_FD_INVALID
 134 # error missing ERTS_SYS_FD_INVALID
 135 #endif
 136 typedef ERTS_SYS_FD_TYPE ErtsSysFdType;
 137 #endif


 206 #define ERTS_ASSERT(e) \
 207     ((void) ((e) ? 1 : (erl_assert_error(#e, __func__, __FILE__, __LINE__), 0)))
 208
 209 __decl_noreturn void __noreturn erl_assert_error(const char* expr, const char *func,
 210                                                  const char* file, int line);
 211
 212 #ifdef DEBUG
 213 #  define ASSERT(e) ERTS_ASSERT(e)
 214 #else
 215 #  define ASSERT(e) ((void) 1)
 216 #endif

 250 /*
 251  * Microsoft C/C++: We certainly want to use stdarg.h and prototypes.
 252  * But MSC doesn't define __STDC__, unless we compile with the -Za
 253  * flag (strict ANSI C, no Microsoft extension).  Compiling with -Za
 254  * doesn't work: some Microsoft headers fail to compile...
 255  *
 256  * Solution: Test if __STDC__ or _MSC_VER is defined.
 257  *
 258  * Note: Simply defining __STDC__ doesn't work, as some Microsoft
 259  * headers will fail to compile!
 260  */
 261
 262 #include <stdarg.h>
 263
 264 /* This isn't sys-dependent, but putting it here benefits sys.c and drivers
 265    - allow use of 'const' regardless of compiler */
 266
 267 #if !defined(__STDC__) && !defined(_MSC_VER)
 268 #  define const
 269 #endif
 270
 271 #undef __deprecated
 272 #if ERTS_AT_LEAST_GCC_VSN__(3, 0, 0)
 273 #  define __deprecated __attribute__((deprecated))
 274 #else
 275 #  define __deprecated
 276 #endif
 277 #if ERTS_AT_LEAST_GCC_VSN__(3, 0, 4)
 278 #  define erts_align_attribute(SZ) __attribute__ ((aligned (SZ)))
 279 #else
 280 #  define erts_align_attribute(SZ)
 281 #endif



 307 #if SIZEOF_VOID_P == 8
 308 #undef  ARCH_32
 309 #define ARCH_64
 310 #define ERTS_SIZEOF_TERM 8
 311 #elif SIZEOF_VOID_P == 4
 312 #define ARCH_32
 313 #undef  ARCH_64
 314 #define ERTS_SIZEOF_TERM 4
 315 #else
 316 #error Neither 32 nor 64 bit architecture
 317 #endif

  1 // TR1 stdarg.h -*- C++ -*-
  2
  3 // Copyright (C) 2006-2013 Free Software Foundation, Inc.
  4 //
  5 // This file is part of the GNU ISO C++ Library.  This library is free
  6 // software; you can redistribute it and/or modify it under the
  7 // terms of the GNU General Public License as published by the
  8 // Free Software Foundation; either version 3, or (at your option)
  9 // any later version.
 10
 11 // This library is distributed in the hope that it will be useful,
 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14 // GNU General Public License for more details.
 15
 16 // Under Section 7 of GPL version 3, you are granted additional
 17 // permissions described in the GCC Runtime Library Exception, version
 18 // 3.1, as published by the Free Software Foundation.
 19
 20 // You should have received a copy of the GNU General Public License and
 21 // a copy of the GCC Runtime Library Exception along with this program;
 22 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 23 // <http://www.gnu.org/licenses/>.
 24
 25 /** @file tr1/stdarg.h
 26  *  This is a TR1 C++ Library header.
 27  */
 28
 29 #ifndef _TR1_STDARG_H
 30 #define _TR1_STDARG_H 1
 31
 32 #include <tr1/cstdarg>
 33
 34 #endif

39 #pragma GCC system_header
 40
 41 #include <bits/c++config.h>
 42 #include <stdarg.h>
 43
 44 #ifndef _GLIBCXX_CSTDARG
 45 #define _GLIBCXX_CSTDARG 1
 46
 47 // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
 48 #ifndef va_end
 49 #define va_end(ap) va_end (ap)
 50 #endif
 51
 52 namespace std
 53 {
 54   using ::va_list;
 55 } // namespace std
 56
 57 #endif
"/usr/include/c++/4.8/cstdarg" 57L, 1844C 



/* Define __gnuc_va_list.  */
 37
 38 #ifndef __GNUC_VA_LIST
 39 #define __GNUC_VA_LIST
 40 typedef __builtin_va_list __gnuc_va_list;
 41 #endif
 42
 43 /* Define the standard macros for the user,
 44    if this invocation was from the user program.  */
 45 #ifdef _STDARG_H
 46
 47 #define va_start(v,l)   __builtin_va_start(v,l)
 48 #define va_end(v)       __builtin_va_end(v)
 49 #define va_arg(v,l)     __builtin_va_arg(v,l)
 50 #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
 51 #define va_copy(d,s)    __builtin_va_copy(d,s)
 52 #endif
 53 #define __va_copy(d,s)  __builtin_va_copy(d,s)
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值