Add WIN32 define for MSVC builds.
1 /* vim: set ts=4 sw=4 tw=99 et:
3 * Copyright (C) 2012 David Anderson
5 * This file is part of SourcePawn.
7 * SourcePawn is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 3 of the License, or (at your option)
12 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with
17 * SourcePawn. If not, see http://www.gnu.org/licenses/.
19 #ifndef _include_jitcraft_string_pool_h_
20 #define _include_jitcraft_string_pool_h_
23 #include "AllocatorPolicies.h"
24 #include "HashTable.h"
32 // Guarantee that strings with the same contents will map to one pointer.
37 typedef String * Payload;
39 static uint32 hash(const CharsAndLength &key) {
40 return HashCharSequence(key.str(), key.length());
43 static bool matches(const CharsAndLength &key, String *string) {
44 if (string->length() != key.length())
46 return memcmp(string->chars(), key.str(), key.length() * sizeof(char)) == 0;
50 typedef HashTable<Policy, ZoneAllocatorPolicy> StringSet;
53 StringPool(Zone *zone);
58 String *add(const char *str, size_t len);
68 #endif // _include_jitcraft_string_pool_h_