Files
sdk/runtime/bin/builtin.h
T
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00

43 lines
1.4 KiB
C

// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef BIN_BUILTIN_H_
#define BIN_BUILTIN_H_
#include <stdio.h>
#include <stdlib.h>
#include "bin/globals.h"
#include "include/dart_api.h"
#ifdef DEBUG
#define ASSERT(expr) assert(expr)
#else
#define ASSERT(expr) USE(expr)
#endif
#define FATAL(error) \
fprintf(stderr, "%s\n", error); \
fflush(stderr); \
abort();
#define UNREACHABLE() \
FATAL("unreachable code")
#define UNIMPLEMENTED() \
FATAL("unimplemented code")
#define FUNCTION_NAME(name) Builtin_##name
#define REGISTER_FUNCTION(name, count) \
{ ""#name, FUNCTION_NAME(name), count },
#define DECLARE_FUNCTION(name, count) \
extern void FUNCTION_NAME(name)(Dart_NativeArguments args);
extern void Builtin_LoadLibrary();
extern void Builtin_ImportLibrary(Dart_Handle library);
extern void Builtin_SetNativeResolver();
extern void PrintString(FILE* out, Dart_Handle object);
#endif // BIN_BUILTIN_H_