Skip to content

Commit

Permalink
Fix building with GCC 3.x
Browse files Browse the repository at this point in the history
R=yangguo@chromium.org
BUG=v8:2016, v8:2017
TEST=

Review URL: https://chromiumcodereview.appspot.com/10823034
Patch from James Pike <g00gle@chilon.net>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@12199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
yangguo@chromium.org committed Jul 26, 2012
1 parent fca280a commit 9265bb0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -28,6 +28,7 @@ Haitao Feng <haitao.feng@intel.com>
Ioseb Dzmanashvili <ioseb.dzmanashvili@gmail.com>
Jan de Mooij <jandemooij@gmail.com>
Jay Freeman <saurik@saurik.com>
James Pike <g00gle@chilon.net>
Joel Stanley <joel.stan@gmail.com>
John Jozwiak <jjozwiak@codeaurora.org>
Jonathan Liu <net147@gmail.com>
Expand Down
7 changes: 4 additions & 3 deletions include/v8-preparser.h
Expand Up @@ -55,11 +55,12 @@
// 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) && defined(V8_SHARED)
#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
(__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
#define V8EXPORT __attribute__ ((visibility("default")))
#else // defined(__GNUC__) && (__GNUC__ >= 4)
#else
#define V8EXPORT
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
#endif

#endif // _WIN32

Expand Down
7 changes: 4 additions & 3 deletions include/v8-profiler.h
Expand Up @@ -50,11 +50,12 @@

// Setup for Linux shared library export. See v8.h in this directory for
// information on how to build/use V8 as shared library.
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
(__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
#define V8EXPORT __attribute__ ((visibility("default")))
#else // defined(__GNUC__) && (__GNUC__ >= 4)
#else
#define V8EXPORT
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
#endif

#endif // _WIN32

Expand Down
7 changes: 4 additions & 3 deletions include/v8-testing.h
Expand Up @@ -50,11 +50,12 @@

// Setup for Linux shared library export. See v8.h in this directory for
// information on how to build/use V8 as shared library.
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
(__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
#define V8EXPORT __attribute__ ((visibility("default")))
#else // defined(__GNUC__) && (__GNUC__ >= 4)
#else
#define V8EXPORT
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
#endif

#endif // _WIN32

Expand Down
7 changes: 4 additions & 3 deletions include/v8.h
Expand Up @@ -63,15 +63,16 @@
#else // _WIN32

// Setup for Linux shared library export.
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
(__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
#ifdef BUILDING_V8_SHARED
#define V8EXPORT __attribute__ ((visibility("default")))
#else
#define V8EXPORT
#endif
#else // defined(__GNUC__) && (__GNUC__ >= 4)
#else
#define V8EXPORT
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
#endif

#endif // _WIN32

Expand Down
2 changes: 1 addition & 1 deletion src/assembler.h
Expand Up @@ -51,7 +51,7 @@ class ApiFunction;
namespace internal {

struct StatsCounter;
const unsigned kNoASTId = -1;
const unsigned kNoASTId = UINT_MAX;
// -----------------------------------------------------------------------------
// Platform independent assembler base class.

Expand Down
4 changes: 2 additions & 2 deletions src/heap.h
Expand Up @@ -1154,7 +1154,7 @@ class Heap {
Object* global_contexts_list() { return global_contexts_list_; }

// Number of mark-sweeps.
int ms_count() { return ms_count_; }
unsigned int ms_count() { return ms_count_; }

// Iterates over all roots in the heap.
void IterateRoots(ObjectVisitor* v, VisitMode mode);
Expand Down Expand Up @@ -1698,7 +1698,7 @@ class Heap {
// Returns the amount of external memory registered since last global gc.
intptr_t PromotedExternalMemorySize();

int ms_count_; // how many mark-sweep collections happened
unsigned int ms_count_; // how many mark-sweep collections happened
unsigned int gc_count_; // how many gc happened

// For post mortem debugging.
Expand Down
2 changes: 1 addition & 1 deletion src/mark-compact.cc
Expand Up @@ -577,7 +577,7 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
p->ClearEvacuationCandidate();

if (FLAG_stress_compaction) {
int counter = space->heap()->ms_count();
unsigned int counter = space->heap()->ms_count();
uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits;
if ((counter & 1) == (page_number & 1)) fragmentation = 1;
} else if (mode == REDUCE_MEMORY_FOOTPRINT) {
Expand Down

0 comments on commit 9265bb0

Please sign in to comment.