Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2324)

Unified Diff: include/v8-preparser.h

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-debug.h ('k') | include/v8-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-preparser.h
diff --git a/include/v8-preparser.h b/include/v8-preparser.h
index 1da77185af86fb90015fe5e6f75e3af22a7495b2..3e39823d65ccdd8d78cd189581bdd6e2e5c7f4a0 100644
--- a/include/v8-preparser.h
+++ b/include/v8-preparser.h
@@ -28,14 +28,48 @@
#ifndef PREPARSER_H
#define PREPARSER_H
-#include "v8.h"
#include "v8stdint.h"
+#ifdef _WIN32
+
+// Setup for Windows DLL export/import. When building the V8 DLL the
+// BUILDING_V8_SHARED needs to be defined. When building a program which uses
+// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
+// static library or building a program which uses the V8 static library neither
+// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
+#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
+#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
+ build configuration to ensure that at most one of these is set
+#endif
+
+#ifdef BUILDING_V8_SHARED
+#define V8EXPORT __declspec(dllexport)
+#elif USING_V8_SHARED
+#define V8EXPORT __declspec(dllimport)
+#else
+#define V8EXPORT
+#endif // BUILDING_V8_SHARED
+
+#else // _WIN32
+
+// Setup for Linux shared library export. There is no need to distinguish
+// between building or using the V8 shared library, but we should not
+// export symbols when we are building a static library.
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
+ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
+#define V8EXPORT __attribute__ ((visibility("default")))
+#else
+#define V8EXPORT
+#endif
+
+#endif // _WIN32
+
+
namespace v8 {
// The result of preparsing is either a stack overflow error, or an opaque
// blob of data that can be passed back into the parser.
-class V8_EXPORT PreParserData {
+class V8EXPORT PreParserData {
public:
PreParserData(size_t size, const uint8_t* data)
: data_(data), size_(size) { }
@@ -60,7 +94,7 @@ class V8_EXPORT PreParserData {
// Interface for a stream of Unicode characters.
-class V8_EXPORT UnicodeInputStream { // NOLINT - V8_EXPORT is not a class name.
+class V8EXPORT UnicodeInputStream { // NOLINT - Thinks V8EXPORT is class name.
public:
virtual ~UnicodeInputStream();
@@ -76,9 +110,11 @@ class V8_EXPORT UnicodeInputStream { // NOLINT - V8_EXPORT is not a class name.
// more stack space than the limit provided, the result's stack_overflow()
// method will return true. Otherwise the result contains preparser
// data that can be used by the V8 parser to speed up parsing.
-PreParserData V8_EXPORT Preparse(UnicodeInputStream* input,
+PreParserData V8EXPORT Preparse(UnicodeInputStream* input,
size_t max_stack_size);
} // namespace v8.
+#undef V8EXPORT
+
#endif // PREPARSER_H
« no previous file with comments | « include/v8-debug.h ('k') | include/v8-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698