summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS7
-rwxr-xr-xemscripten.py25
-rw-r--r--src/jsifier.js204
-rw-r--r--src/library_browser.js3
-rw-r--r--src/library_glfw.js586
-rw-r--r--src/library_sdl.js13
-rw-r--r--src/modules.js2
-rw-r--r--src/parseTools.js144
-rw-r--r--system/include/GL/glfw.h518
-rw-r--r--system/include/libcxx/__bit_reference10
-rw-r--r--system/include/libcxx/__config47
-rw-r--r--system/include/libcxx/__debug18
-rw-r--r--system/include/libcxx/__functional_0314
-rw-r--r--system/include/libcxx/__functional_base10
-rw-r--r--system/include/libcxx/__functional_base_032
-rw-r--r--system/include/libcxx/__hash_table40
-rw-r--r--system/include/libcxx/__locale86
-rw-r--r--system/include/libcxx/__mutex_base16
-rw-r--r--system/include/libcxx/__std_stream30
-rw-r--r--system/include/libcxx/__tree42
-rw-r--r--system/include/libcxx/__tuple30
-rw-r--r--system/include/libcxx/__tuple_034
-rw-r--r--system/include/libcxx/array10
-rw-r--r--system/include/libcxx/bitset10
-rw-r--r--system/include/libcxx/chrono18
-rw-r--r--system/include/libcxx/codecvt6
-rw-r--r--system/include/libcxx/complex14
-rw-r--r--system/include/libcxx/condition_variable4
-rw-r--r--system/include/libcxx/cstddef2
-rw-r--r--system/include/libcxx/cwchar2
-rw-r--r--system/include/libcxx/deque10
-rw-r--r--system/include/libcxx/exception18
-rw-r--r--system/include/libcxx/ext/__hash6
-rw-r--r--system/include/libcxx/ext/hash_map26
-rw-r--r--system/include/libcxx/ext/hash_set4
-rw-r--r--system/include/libcxx/forward_list14
-rw-r--r--system/include/libcxx/fstream8
-rw-r--r--system/include/libcxx/functional106
-rw-r--r--system/include/libcxx/future38
-rw-r--r--system/include/libcxx/initializer_list2
-rw-r--r--system/include/libcxx/ios16
-rw-r--r--system/include/libcxx/iosfwd40
-rw-r--r--system/include/libcxx/iostream16
-rw-r--r--system/include/libcxx/istream21
-rw-r--r--system/include/libcxx/iterator36
-rw-r--r--system/include/libcxx/limits8
-rw-r--r--system/include/libcxx/list10
-rw-r--r--system/include/libcxx/locale70
-rw-r--r--system/include/libcxx/map24
-rw-r--r--system/include/libcxx/memory62
-rw-r--r--system/include/libcxx/mutex10
-rw-r--r--system/include/libcxx/new24
-rw-r--r--system/include/libcxx/ostream6
-rw-r--r--system/include/libcxx/queue10
-rw-r--r--system/include/libcxx/random98
-rw-r--r--system/include/libcxx/ratio22
-rw-r--r--system/include/libcxx/readme.txt2
-rw-r--r--system/include/libcxx/regex24
-rw-r--r--system/include/libcxx/scoped_allocator2
-rw-r--r--system/include/libcxx/set4
-rw-r--r--system/include/libcxx/sstream8
-rw-r--r--system/include/libcxx/stack6
-rw-r--r--system/include/libcxx/streambuf2
-rw-r--r--system/include/libcxx/string16
-rw-r--r--system/include/libcxx/strstream8
-rw-r--r--system/include/libcxx/system_error22
-rw-r--r--system/include/libcxx/thread20
-rw-r--r--system/include/libcxx/tuple16
-rw-r--r--system/include/libcxx/type_traits360
-rw-r--r--system/include/libcxx/typeindex6
-rw-r--r--system/include/libcxx/unordered_map26
-rw-r--r--system/include/libcxx/unordered_set4
-rw-r--r--system/include/libcxx/utility18
-rw-r--r--system/include/libcxx/valarray40
-rw-r--r--system/include/libcxx/vector93
-rw-r--r--system/lib/libcxx/chrono.cpp4
-rw-r--r--system/lib/libcxx/debug.cpp4
-rw-r--r--system/lib/libcxx/exception.cpp4
-rw-r--r--system/lib/libcxx/iostream.cpp14
-rw-r--r--system/lib/libcxx/locale.cpp18
-rw-r--r--system/lib/libcxx/memory.cpp10
-rw-r--r--system/lib/libcxx/new.cpp2
-rw-r--r--system/lib/libcxx/readme.txt2
-rw-r--r--system/lib/libcxx/stdexcept.cpp2
-rw-r--r--system/lib/libcxx/string.cpp2
-rw-r--r--system/lib/libcxx/strstream.cpp2
-rw-r--r--system/lib/libcxx/symbols18
-rw-r--r--system/lib/libcxx/thread.cpp4
-rw-r--r--system/lib/libcxx/typeinfo.cpp4
-rw-r--r--tests/glfw.c389
-rwxr-xr-xtests/runner.py7
-rw-r--r--tests/sdl_rotozoom.c6
-rw-r--r--tests/sdl_rotozoom.pngbin338527 -> 360054 bytes
-rw-r--r--tools/js_optimizer.py2
-rw-r--r--tools/shared.py11
95 files changed, 2727 insertions, 1077 deletions
diff --git a/AUTHORS b/AUTHORS
index bbbca339..438a13ff 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,7 +24,7 @@ a license to everyone to use it as detailed in LICENSE.)
* Pierre Renaux <pierre@talansoft.com>
* Brian Anderson <banderson@mozilla.com>
* Jon Bardin <diclophis@gmail.com>
-* Jukka Jylänki <jujjyl@gmail.com>
+* Jukka Jylänki <jujjyl@gmail.com>
* Aleksander Guryanov <caiiiycuk@gmail.com>
* Chad Austin <chad@chadaustin.me> (copyright owned by IMVU)
* nandhp <nandhp@gmail.com>
@@ -46,7 +46,7 @@ a license to everyone to use it as detailed in LICENSE.)
* Anthony Liot <wolfviking0@yahoo.com>
* Michael Riss <Michael.Riss@gmx.de>
* Jasper St. Pierre <jstpierre@mecheye.net>
-* Manuel Schölling <manuel.schoelling@gmx.de>
+* Manuel Schölling <manuel.schoelling@gmx.de>
* Bruce Mitchener, Jr. <bruce.mitchener@gmail.com>
* Michael Bishop <mbtyke@gmail.com>
* Roger Braun <roger@rogerbraun.net>
@@ -55,5 +55,8 @@ a license to everyone to use it as detailed in LICENSE.)
* Tobias Doerffel <tobias.doerffel@gmail.com>
* Martin von Gagern <martin@von-gagern.net>
* Ting-Yuan Huang <thuang@mozilla.com>
+* Felix H. Dahlke <fhd@ubercode.de>
+* Éloi Rivard <azmeuk@gmail.com>
* Alexander Gladysh <ag@logiceditor.com>
+
diff --git a/emscripten.py b/emscripten.py
index d41aaa2c..8f68ee77 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -20,6 +20,15 @@ def path_from_root(*pathelems):
"""
return os.path.join(__rootpath__, *pathelems)
+def get_configuration():
+ if hasattr(get_configuration, 'configuration'):
+ return get_configuration.configuration
+
+ from tools import shared
+ configuration = shared.Configuration(environ=os.environ)
+ get_configuration.configuration = configuration
+ return configuration
+
def scan(ll, settings):
# blockaddress(@main, %23)
blockaddrs = []
@@ -299,7 +308,12 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
indexing = forwarded_json['Functions']['indexedFunctions']
def indexize(js):
- return re.sub(r"'{{ FI_([\w\d_$]+) }}'", lambda m: str(indexing.get(m.groups(0)[0]) or 0), js)
+ # In the global initial allocation, we need to split up into Uint8 format
+ def split_32(x):
+ x = int(x)
+ return '%d,%d,%d,%d' % (x&255, (x >> 8)&255, (x >> 16)&255, (x >> 24)&255)
+ ret = re.sub(r"\"?'?{{ FI_([\w\d_$]+) }}'?\"?,0,0,0", lambda m: split_32(indexing.get(m.groups(0)[0]) or 0), js)
+ return re.sub(r"'{{ FI_([\w\d_$]+) }}'", lambda m: str(indexing.get(m.groups(0)[0]) or 0), ret)
blockaddrs = forwarded_json['Functions']['blockAddresses']
def blockaddrsize(js):
@@ -683,15 +697,6 @@ WARNING: You should normally never use this! Use emcc instead.
else:
relooper = None # use the cache
- def get_configuration():
- if hasattr(get_configuration, 'configuration'):
- return get_configuration.configuration
-
- from tools import shared
- configuration = shared.Configuration(environ=os.environ)
- get_configuration.configuration = configuration
- return configuration
-
if keywords.temp_dir is None:
temp_files = get_configuration().get_temp_files()
else:
diff --git a/src/jsifier.js b/src/jsifier.js
index 69d9842a..ce089334 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -231,12 +231,11 @@ function JSify(data, functionsOnly, givenFunctions) {
if (value.intertype in PARSABLE_LLVM_FUNCTIONS) {
return [finalizeLLVMFunctionCall(value)];
} else if (Runtime.isNumberType(type) || pointingLevels(type) >= 1) {
- return makeGlobalUse(indexizeFunctions(parseNumerical(value.value), type));
+ return [makeGlobalUse(indexizeFunctions(parseNumerical(value.value), type))];
} else if (value.intertype === 'emptystruct') {
return makeEmptyStruct(type);
} else if (value.intertype === 'string') {
- return JSON.stringify(parseLLVMString(value.text)) +
- ' /* ' + value.text.substr(0, 20).replace(/[*<>]/g, '_') + ' */'; // make string safe for inclusion in comment
+ return parseLLVMString(value.text);
} else {
return alignStruct(handleSegments(value.contents), type);
}
@@ -244,9 +243,7 @@ function JSify(data, functionsOnly, givenFunctions) {
function parseConst(value, type, ident) {
var constant = makeConst(value, type);
- if (typeof constant === 'object') {
- constant = flatten(constant).map(function(x) { return parseNumerical(x) })
- }
+ constant = flatten(constant).map(function(x) { return parseNumerical(x) })
return constant;
}
@@ -254,6 +251,7 @@ function JSify(data, functionsOnly, givenFunctions) {
substrate.addActor('GlobalVariable', {
processItem: function(item) {
function needsPostSet(value) {
+ if (typeof value !== 'string') return false;
return value[0] in UNDERSCORE_OPENPARENS || value.substr(0, 14) === 'CHECK_OVERFLOW'
|| value.substr(0, 6) === 'GLOBAL';
}
@@ -266,105 +264,82 @@ function JSify(data, functionsOnly, givenFunctions) {
item.ctors.map(function(ctor) { return ' { func: function() { ' + ctor + '() } }' }).join(',\n') +
'\n]);\n';
return ret;
+ }
+
+ var constant = null;
+ var allocator = (BUILD_AS_SHARED_LIB && !item.external) ? 'ALLOC_NORMAL' : 'ALLOC_STATIC';
+ var index = null;
+ if (item.external && BUILD_AS_SHARED_LIB) {
+ // External variables in shared libraries should not be declared as
+ // they would shadow similarly-named globals in the parent.
+ item.JS = '';
} else {
- var constant = null;
- var allocator = (BUILD_AS_SHARED_LIB && !item.external) ? 'ALLOC_NORMAL' : 'ALLOC_STATIC';
- var index = null;
- if (item.external && BUILD_AS_SHARED_LIB) {
- // External variables in shared libraries should not be declared as
- // they would shadow similarly-named globals in the parent.
- item.JS = '';
- } else {
- item.JS = makeGlobalDef(item.ident);
- }
+ item.JS = makeGlobalDef(item.ident);
+ }
- if (item.external && !ASM_JS) { // ASM_JS considers externs to be globals
- // Import external global variables from the library if available.
- var shortident = item.ident.slice(1);
- if (LibraryManager.library[shortident] &&
- LibraryManager.library[shortident].length &&
- !BUILD_AS_SHARED_LIB) {
- if (addedLibraryItems[shortident]) return ret;
- var val = LibraryManager.library[shortident];
- var padding;
- if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {
- padding = [item.type].concat(zeros(Runtime.getNativeFieldSize(item.type)-1));
- } else {
- padding = makeEmptyStruct(item.type);
- }
- var padded = val.concat(padding.slice(val.length));
- var js = item.ident + '=' + makePointer(padded, null, allocator, item.type, index) + ';'
- if (LibraryManager.library[shortident + '__postset']) {
- js += '\n' + LibraryManager.library[shortident + '__postset'];
- }
- ret.push({
- intertype: 'GlobalVariablePostSet',
- JS: js
- });
- }
- return ret;
+ if (!NAMED_GLOBALS && isIndexableGlobal(item.ident)) {
+ index = makeGlobalUse(item.ident); // index !== null indicates we are indexing this
+ allocator = 'ALLOC_NONE';
+ }
+ if (item.external) {
+ if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {
+ constant = zeros(Runtime.getNativeFieldSize(item.type));
} else {
- if (!NAMED_GLOBALS && isIndexableGlobal(item.ident)) {
- index = makeGlobalUse(item.ident); // index !== null indicates we are indexing this
- allocator = 'ALLOC_NONE';
- }
- if (item.external) {
- assert(ASM_JS);
- if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {
- constant = zeros(Runtime.getNativeFieldSize(item.type));
- } else {
- constant = makeEmptyStruct(item.type);
- }
- constant = JSON.stringify(constant);
- } else {
- constant = parseConst(item.value, item.type, item.ident);
- }
- if (typeof constant === 'string' && constant[0] != '[') {
- constant = [constant]; // A single item. We may need a postset for it.
- }
- if (typeof constant === 'object') {
- // This is a flattened object. We need to find its idents, so they can be assigned to later
- constant.forEach(function(value, i) {
- if (needsPostSet(value)) { // ident, or expression containing an ident
- ret.push({
- intertype: 'GlobalVariablePostSet',
- JS: makeSetValue(makeGlobalUse(item.ident), i, value, 'i32', false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
- });
- constant[i] = '0';
- }
- });
- }
- // NOTE: This is the only place that could potentially create static
- // allocations in a shared library.
- constant = makePointer(constant, null, allocator, item.type, index);
- var js;
-
- js = (index !== null ? '' : item.ident + '=') + constant + ';'; // \n Module.print("' + item.ident + ' :" + ' + makeGlobalUse(item.ident) + ');';
+ constant = makeEmptyStruct(item.type);
+ }
+ } else {
+ constant = parseConst(item.value, item.type, item.ident);
+ }
+ assert(typeof constant === 'object');//, [typeof constant, JSON.stringify(constant), item.external]);
- // Special case: class vtables. We make sure they are null-terminated, to allow easy runtime operations
- if (item.ident.substr(0, 5) == '__ZTV') {
- if (index !== null) {
- index = getFastValue(index, '+', Runtime.alignMemory(calcAllocatedSize(Variables.globals[item.ident].type)));
- }
- js += '\n' + makePointer([0], null, allocator, ['void*'], index) + ';';
- }
- if (!ASM_JS && (EXPORT_ALL || (item.ident in EXPORTED_GLOBALS))) {
- js += '\nModule["' + item.ident + '"] = ' + item.ident + ';';
- }
- if (BUILD_AS_SHARED_LIB == 2 && !item.private_) {
- // TODO: make the assert conditional on ASSERTIONS
- js += 'if (globalScope) { assert(!globalScope["' + item.ident + '"]); globalScope["' + item.ident + '"] = ' + item.ident + ' }';
- }
- if (item.external && !NAMED_GLOBALS) {
- assert(ASM_JS);
- js = 'var ' + item.ident + ' = ' + js; // force an explicit naming, even if unnamed globals, for asm forwarding
- }
- return ret.concat({
- intertype: 'GlobalVariable',
- JS: js,
+ // This is a flattened object. We need to find its idents, so they can be assigned to later
+ constant.forEach(function(value, i) {
+ if (needsPostSet(value)) { // ident, or expression containing an ident
+ ret.push({
+ intertype: 'GlobalVariablePostSet',
+ JS: makeSetValue(makeGlobalUse(item.ident), i, value, 'i32', false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
});
+ constant[i] = '0';
}
+ });
+
+ if (item.external) {
+ // External variables in shared libraries should not be declared as
+ // they would shadow similarly-named globals in the parent, so do nothing here.
+ if (BUILD_AS_SHARED_LIB) return ret;
+ // Library items need us to emit something, but everything else requires nothing.
+ if (!LibraryManager.library[item.ident.slice(1)]) return ret;
+ }
+
+ // ensure alignment
+ constant = constant.concat(zeros(Runtime.alignMemory(constant.length) - constant.length));
+
+ // Special case: class vtables. We make sure they are null-terminated, to allow easy runtime operations
+ if (item.ident.substr(0, 5) == '__ZTV') {
+ constant = constant.concat(zeros(Runtime.alignMemory(QUANTUM_SIZE)));
}
+
+ // NOTE: This is the only place that could potentially create static
+ // allocations in a shared library.
+ constant = makePointer(constant, null, allocator, item.type, index);
+
+ var js = (index !== null ? '' : item.ident + '=') + constant;
+ if (js) js += ';';
+
+ if (!ASM_JS && (EXPORT_ALL || (item.ident in EXPORTED_GLOBALS))) {
+ js += '\nModule["' + item.ident + '"] = ' + item.ident + ';';
+ }
+ if (BUILD_AS_SHARED_LIB == 2 && !item.private_) {
+ // TODO: make the assert conditional on ASSERTIONS
+ js += 'if (globalScope) { assert(!globalScope["' + item.ident + '"]); globalScope["' + item.ident + '"] = ' + item.ident + ' }';
+ }
+ if (item.external && !NAMED_GLOBALS) {
+ js = 'var ' + item.ident + ' = ' + js; // force an explicit naming, even if unnamed globals, for asm forwarding
+ }
+ return ret.concat({
+ intertype: 'GlobalVariable',
+ JS: js,
+ });
}
});
@@ -1523,8 +1498,36 @@ function JSify(data, functionsOnly, givenFunctions) {
print('assert(STATICTOP < TOTAL_MEMORY);\n');
}
}
- var generated = itemsDict.function.concat(itemsDict.type).concat(itemsDict.GlobalVariableStub).concat(itemsDict.GlobalVariable).concat(itemsDict.GlobalVariablePostSet);
- if (!DEBUG_MEMORY) print(generated.map(function(item) { return item.JS }).join('\n'));
+ var generated = itemsDict.function.concat(itemsDict.type).concat(itemsDict.GlobalVariableStub).concat(itemsDict.GlobalVariable);
+ print(generated.map(function(item) { return item.JS }).join('\n'));
+
+ if (phase == 'pre') {
+ if (memoryInitialization.length > 0) {
+ // apply postsets directly into the big memory initialization
+ itemsDict.GlobalVariablePostSet = itemsDict.GlobalVariablePostSet.filter(function(item) {
+ var m;
+ if (m = /^HEAP([\dFU]+)\[([()>\d]+)\] *= *([()|\d{}\w_' ]+);?$/.exec(item.JS)) {
+ var type = getTypeFromHeap(m[1]);
+ var bytes = Runtime.getNativeTypeSize(type);
+ var target = eval(m[2]) << log2(bytes);
+ var value = m[3];
+ try {
+ value = eval(value);
+ } catch(e) {
+ // possibly function table {{{ FT_* }}} etc.
+ if (value.indexOf('{{ ') < 0) return true;
+ }
+ writeInt8s(memoryInitialization, target - TOTAL_STACK, value, type);
+ return false;
+ }
+ return true;
+ });
+ // write out the singleton big memory initialization value
+ print('/* memory initializer */ ' + makePointer(memoryInitialization, null, 'ALLOC_NONE', 'i8', 'TOTAL_STACK', true)); // we assert on TOTAL_STACK == GLOBAL_BASE
+ }
+ }
+
+ print(itemsDict.GlobalVariablePostSet.map(function(item) { return item.JS }).join('\n'));
return;
}
@@ -1546,7 +1549,6 @@ function JSify(data, functionsOnly, givenFunctions) {
}
});
}
-
JSify(globalsData, true, Functions);
globalsData = null;
data.unparsedGlobalss = null;
diff --git a/src/library_browser.js b/src/library_browser.js
index b1e4190b..099516a8 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -75,8 +75,7 @@ mergeInto(LibraryManager.library, {
'ogg': 'audio/ogg',
'wav': 'audio/wav',
'mp3': 'audio/mpeg'
- }[name.substr(-3)];
- return ret;
+ }[name.substr(name.lastIndexOf('.')+1)];
}
if (!Module["preloadPlugins"]) Module["preloadPlugins"] = [];
diff --git a/src/library_glfw.js b/src/library_glfw.js
new file mode 100644
index 00000000..71552cd8
--- /dev/null
+++ b/src/library_glfw.js
@@ -0,0 +1,586 @@
+/*******************************************************************************
+ * EMSCRIPTEN GLFW 2.7.7 emulation.
+ * It tries to emulate the behavior described in
+ * http://www.glfw.org/GLFWReference277.pdf
+ *
+ * What it does:
+ * - Creates a GL context.
+ * - Manage keyboard and mouse events.
+ * - GL Extensions support.
+ *
+ * What it does not but should probably do:
+ * - Transmit events when glfwPollEvents, glfwWaitEvents or glfwSwapBuffers is
+ * called. Events callbacks are called as soon as event are received.
+ * - Thread emulation.
+ * - Joystick support.
+ * - Image/Texture I/O support (that is deleted in GLFW 3).
+ * - Video modes detection.
+ *
+ * Authors:
+ * - Éloi Rivard <eloi.rivard@gmail.com>
+ *
+ ******************************************************************************/
+
+var LibraryGLFW = {
+ $GLFW: {
+
+ keyFunc: null,
+ charFunc: null,
+ mouseButtonFunc: null,
+ mousePosFunc: null,
+ mouseWheelFunc: null,
+ resizeFunc: null,
+ closeFunc: null,
+ refreshFunc: null,
+ mouseFunc: null,
+ params: null,
+ initTime: null,
+ wheelPos: 0,
+ lastX: 0,
+ lastY: 0,
+ buttons: 0,
+ keys: 0,
+ initWindowWidth: 640,
+ initWindowHeight: 480,
+ windowX: 0,
+ windowY: 0,
+ windowWidth: 0,
+ windowHeight: 0,
+
+/*******************************************************************************
+ * DOM EVENT CALLBACKS
+ ******************************************************************************/
+
+ DOMToGLFWKeyCode: function(keycode) {
+ switch (keycode) {
+ case 0x09: return 295 ; //DOM_VK_TAB -> GLFW_KEY_TAB
+ case 0x1B: return 255 ; //DOM_VK_ESCAPE -> GLFW_KEY_ESC
+ case 0x6A: return 313 ; //DOM_VK_MULTIPLY -> GLFW_KEY_KP_MULTIPLY
+ case 0x6B: return 315 ; //DOM_VK_ADD -> GLFW_KEY_KP_ADD
+ case 0x6D: return 314 ; //DOM_VK_SUBTRACT -> GLFW_KEY_KP_SUBTRACT
+ case 0x6E: return 316 ; //DOM_VK_DECIMAL -> GLFW_KEY_KP_DECIMAL
+ case 0x6F: return 312 ; //DOM_VK_DIVIDE -> GLFW_KEY_KP_DIVIDE
+ case 0x70: return 258 ; //DOM_VK_F1 -> GLFW_KEY_F1
+ case 0x71: return 259 ; //DOM_VK_F2 -> GLFW_KEY_F2
+ case 0x72: return 260 ; //DOM_VK_F3 -> GLFW_KEY_F3
+ case 0x73: return 261 ; //DOM_VK_F4 -> GLFW_KEY_F4
+ case 0x74: return 262 ; //DOM_VK_F5 -> GLFW_KEY_F5
+ case 0x75: return 263 ; //DOM_VK_F6 -> GLFW_KEY_F6
+ case 0x76: return 264 ; //DOM_VK_F7 -> GLFW_KEY_F7
+ case 0x77: return 265 ; //DOM_VK_F8 -> GLFW_KEY_F8
+ case 0x78: return 266 ; //DOM_VK_F9 -> GLFW_KEY_F9
+ case 0x79: return 267 ; //DOM_VK_F10 -> GLFW_KEY_F10
+ case 0x7a: return 268 ; //DOM_VK_F11 -> GLFW_KEY_F11
+ case 0x7b: return 269 ; //DOM_VK_F12 -> GLFW_KEY_F12
+ case 0x25: return 285 ; //DOM_VK_LEFT -> GLFW_KEY_LEFT
+ case 0x26: return 283 ; //DOM_VK_UP -> GLFW_KEY_UP
+ case 0x27: return 286 ; //DOM_VK_RIGHT -> GLFW_KEY_RIGHT
+ case 0x28: return 284 ; //DOM_VK_DOWN -> GLFW_KEY_DOWN
+ case 0x21: return 298 ; //DOM_VK_PAGE_UP -> GLFW_KEY_PAGEUP
+ case 0x22: return 299 ; //DOM_VK_PAGE_DOWN -> GLFW_KEY_PAGEDOWN
+ case 0x24: return 300 ; //DOM_VK_HOME -> GLFW_KEY_HOME
+ case 0x23: return 301 ; //DOM_VK_END -> GLFW_KEY_END
+ case 0x2d: return 296 ; //DOM_VK_INSERT -> GLFW_KEY_INSERT
+ case 16 : return 287 ; //DOM_VK_SHIFT -> GLFW_KEY_LSHIFT
+ case 0x05: return 287 ; //DOM_VK_LEFT_SHIFT -> GLFW_KEY_LSHIFT
+ case 0x06: return 288 ; //DOM_VK_RIGHT_SHIFT -> GLFW_KEY_RSHIFT
+ case 17 : return 289 ; //DOM_VK_CONTROL -> GLFW_KEY_LCTRL
+ case 0x03: return 289 ; //DOM_VK_LEFT_CONTROL -> GLFW_KEY_LCTRL
+ case 0x04: return 290 ; //DOM_VK_RIGHT_CONTROL -> GLFW_KEY_RCTRL
+ case 18 : return 291 ; //DOM_VK_ALT -> GLFW_KEY_LALT
+ case 0x02: return 291 ; //DOM_VK_LEFT_ALT -> GLFW_KEY_LALT
+ case 0x01: return 292 ; //DOM_VK_RIGHT_ALT -> GLFW_KEY_RALT
+ case 96 : return 302 ; //GLFW_KEY_KP_0
+ case 97 : return 303 ; //GLFW_KEY_KP_1
+ case 98 : return 304 ; //GLFW_KEY_KP_2
+ case 99 : return 305 ; //GLFW_KEY_KP_3
+ case 100 : return 306 ; //GLFW_KEY_KP_4
+ case 101 : return 307 ; //GLFW_KEY_KP_5
+ case 102 : return 308 ; //GLFW_KEY_KP_6
+ case 103 : return 309 ; //GLFW_KEY_KP_7
+ case 104 : return 310 ; //GLFW_KEY_KP_8
+ case 105 : return 311 ; //GLFW_KEY_KP_9
+ default : return keycode;
+ };
+ },
+
+ //UCS-2 to UTF16 (ISO 10646)
+ getUnicodeChar: function(value) {
+ var output = '';
+ if (value > 0xFFFF) {
+ value -= 0x10000;
+ output += String.fromCharCode(value >>> 10 & 0x3FF | 0xD800);
+ value = 0xDC00 | value & 0x3FF;
+ }
+ output += String.fromCharCode(value);
+ return output;
+ },
+
+ onKeyPress: function(event) {
+ //charCode is only available whith onKeyPress event
+ var char = GLFW.getUnicodeChar(event.charCode);
+
+ if (event.charCode) {
+ var char = GLFW.getUnicodeChar(event.charCode);
+ if (char !== null && GLFW.charFunc) {
+ event.preventDefault();
+ Runtime.dynCall('vii', GLFW.charFunc, [event.charCode, 1]);
+ }
+ }
+ },
+
+ onKeyChanged: function(event, status) {
+ var key = GLFW.DOMToGLFWKeyCode(event.keyCode);
+ if (key && GLFW.keyFunc) {
+ GLFW.keys[key] = status;
+ event.preventDefault();
+ Runtime.dynCall('vii', GLFW.keyFunc, [key, status]);
+ }
+ },
+
+ onKeydown: function(event) {
+ GLFW.onKeyChanged(event, 1);//GLFW_PRESS
+ },
+
+ onKeyup: function(event) {
+ GLFW.onKeyChanged(event, 0);//GLFW_RELEASE
+ },
+
+ savePosition: function(event) {
+ /* TODO maybe loop here ala http://www.quirksmode.org/js/findpos.html */
+ GLFW.lastX = event['clientX'] - Module['canvas'].offsetLeft;
+ GLFW.lastY = event['clientY'] - Module['canvas'].offsetTop;
+ },
+
+ onMousemove: function(event) {
+ /* Send motion event only if the motion changed, prevents
+ * spamming our app with uncessary callback call. It does happen in
+ * Chrome on Windows.
+ */
+ var newX = event['clientX'] - Module['canvas'].offsetLeft;
+ var newY = event['clientY'] - Module['canvas'].offsetTop;
+ if (newX == GLFW.lastX && newY == GLFW.lastY) {
+ return;
+ }
+
+ GLFW.savePosition(event);
+
+ if (event.target == Module["canvas"] && GLFW.mousePosFunc) {
+ event.preventDefault();
+ Runtime.dynCall('vii', GLFW.mousePosFunc, [GLFW.lastX, GLFW.lastY]);
+ }
+ },
+
+ onMouseButtonChanged: function(event, status) {
+ if (GLFW.mouseButtonFunc == null) {
+ return;
+ }
+
+ GLFW.savePosition(event);
+ if (event.target != Module["canvas"]) {
+ return;
+ }
+
+ if (status == 1) {//GLFW_PRESS
+ try {
+ event.target.setCapture();
+ } catch (e) {}
+ }
+
+ event.preventDefault();
+ //DOM and glfw have the same button codes
+ Runtime.dynCall('vii', GLFW.mouseButtonFunc, [event['button'], status]);
+ },
+
+ onMouseButtonDown: function(event) {
+ GLFW.buttons |= (1 << event['button']);
+ GLFW.onMouseButtonChanged(event, 1);//GLFW_PRESS
+ },
+
+ onMouseButtonUp: function(event) {
+ GLFW.buttons &= ~(1 << event['button']);
+ GLFW.onMouseButtonChanged(event, 0);//GLFW_RELEASE
+ },
+
+ onMouseWheel: function(event) {
+ if (event.detail > 0) {
+ GLFW.wheelPos++;
+ }
+
+ if (event.detail < 0) {
+ GLFW.wheelPos--;
+ }
+
+ if (GLFW.mouseWheelFunc && event.target == Module["canvas"]) {
+ Runtime.dynCall('vi', GLFW.mouseWheelFunc, [GLFW.wheelPos]);
+ event.preventDefault();
+ }
+ },
+
+ // TODO add fullscreen API ala:
+ // http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
+ onFullScreenEventChange: function(event) {
+ var width;
+ var height;
+ if (document["fullScreen"] || document["mozFullScreen"] || document["webkitIsFullScreen"]) {
+ width = screen["width"];
+ height = screen["height"];
+ }
+ else {
+ width = GLFW.windowWidth;
+ height = GLFW.windowHeight;
+ // TODO set position
+ document.removeEventListener('fullscreenchange', GLFW.onFullScreenEventChange, true);
+ document.removeEventListener('mozfullscreenchange', GLFW.onFullScreenEventChange, true);
+ document.removeEventListener('webkitfullscreenchange', GLFW.onFullScreenEventChange, true);
+ }
+ Browser.setCanvasSize(width, height);
+
+ if (GLFW.resizeFunc) {
+ Runtime.dynCall('vii', GLFW.resizeFunc, [width, height]);
+ }
+ },
+
+ requestFullScreen: function() {
+ var RFS = Module["canvas"]['requestFullscreen'] ||
+ Module["canvas"]['requestFullScreen'] ||
+ Module["canvas"]['mozRequestFullScreen'] ||
+ Module["canvas"]['webkitRequestFullScreen'] ||
+ (function() {});
+ RFS.apply(Module["canvas"], []);
+ },
+
+ cancelFullScreen: function() {
+ var CFS = document['exitFullscreen'] ||
+ document['cancelFullScreen'] ||
+ document['mozCancelFullScreen'] ||
+ document['webkitCancelFullScreen'] ||
+ (function() {});
+ CFS.apply(document, []);
+ }
+ },
+
+/*******************************************************************************
+ * GLFW FUNCTIONS
+ ******************************************************************************/
+
+ /* GLFW initialization, termination and version querying */
+ glfwInit: function() {
+ GLFW.initTime = Date.now() / 1000;
+
+ window.addEventListener("keydown", GLFW.onKeydown, true);
+ window.addEventListener("keypress", GLFW.onKeyPress, true);
+ window.addEventListener("keyup", GLFW.onKeyup, true);
+ window.addEventListener("mousemove", GLFW.onMousemove, true);
+ window.addEventListener("mousedown", GLFW.onMouseButtonDown, true);
+ window.addEventListener("mouseup", GLFW.onMouseButtonUp, true);
+ window.addEventListener('DOMMouseScroll', GLFW.onMouseWheel, true);
+ window.addEventListener('mousewheel', GLFW.onMouseWheel, true);
+
+ __ATEXIT__.push({ func: function() {
+ window.removeEventListener("keydown", GLFW.onKeydown, true);
+ window.removeEventListener("keypress", GLFW.onKeyPress, true);
+ window.removeEventListener("keyup", GLFW.onKeyup, true);
+ window.removeEventListener("mousemove", GLFW.onMousemove, true);
+ window.removeEventListener("mousedown", GLFW.onMouseButtonDown, true);
+ window.removeEventListener("mouseup", GLFW.onMouseButtonUp, true);
+ window.removeEventListener('DOMMouseScroll', GLFW.onMouseWheel, true);
+ window.removeEventListener('mousewheel', GLFW.onMouseWheel, true);
+ Module["canvas"].width = Module["canvas"].height = 1;
+ }});
+
+ //TODO: Init with correct values
+ GLFW.params = new Array();
+ GLFW.params[0x00030001] = true; //GLFW_MOUSE_CURSOR
+ GLFW.params[0x00030002] = false; //GLFW_STICKY_KEYS
+ GLFW.params[0x00030003] = true; //GLFW_STICKY_MOUSE_BUTTONS
+ GLFW.params[0x00030004] = false; //GLFW_SYSTEM_KEYS
+ GLFW.params[0x00030005] = false; //GLFW_KEY_REPEAT
+ GLFW.params[0x00030006] = true; //GLFW_AUTO_POLL_EVENTS
+ GLFW.params[0x00020001] = true; //GLFW_OPENED
+ GLFW.params[0x00020002] = true; //GLFW_ACTIVE
+ GLFW.params[0x00020003] = false; //GLFW_ICONIFIED
+ GLFW.params[0x00020004] = true; //GLFW_ACCELERATED
+ GLFW.params[0x00020005] = 0; //GLFW_RED_BITS
+ GLFW.params[0x00020006] = 0; //GLFW_GREEN_BITS
+ GLFW.params[0x00020007] = 0; //GLFW_BLUE_BITS
+ GLFW.params[0x00020008] = 0; //GLFW_ALPHA_BITS
+ GLFW.params[0x00020009] = 0; //GLFW_DEPTH_BITS
+ GLFW.params[0x0002000A] = 0; //GLFW_STENCIL_BITS
+ GLFW.params[0x0002000B] = 0; //GLFW_REFRESH_RATE
+ GLFW.params[0x0002000C] = 0; //GLFW_ACCUM_RED_BITS
+ GLFW.params[0x0002000D] = 0; //GLFW_ACCUM_GREEN_BITS
+ GLFW.params[0x0002000E] = 0; //GLFW_ACCUM_BLUE_BITS
+ GLFW.params[0x0002000F] = 0; //GLFW_ACCUM_ALPHA_BITS
+ GLFW.params[0x00020010] = 0; //GLFW_AUX_BUFFERS
+ GLFW.params[0x00020011] = 0; //GLFW_STEREO
+ GLFW.params[0x00020012] = 0; //GLFW_WINDOW_NO_RESIZE
+ GLFW.params[0x00020013] = 0; //GLFW_FSAA_SAMPLES
+ GLFW.params[0x00020014] = 0; //GLFW_OPENGL_VERSION_MAJOR
+ GLFW.params[0x00020015] = 0; //GLFW_OPENGL_VERSION_MINOR
+ GLFW.params[0x00020016] = 0; //GLFW_OPENGL_FORWARD_COMPAT
+ GLFW.params[0x00020017] = 0; //GLFW_OPENGL_DEBUG_CONTEXT
+ GLFW.params[0x00020018] = 0; //GLFW_OPENGL_PROFILE
+
+ GLFW.keys = new Array();
+
+ return 1; //GL_TRUE
+ },
+
+ glfwTerminate: function() {},
+
+ glfwGetVersion: function(major, minor, rev) {
+ setValue(major, 2, 'i32');
+ setValue(minor, 7, 'i32');
+ setValue(rev, 7, 'i32');
+ },
+
+ /* Window handling */
+ glfwOpenWindow__deps: ['$Browser'],
+ glfwOpenWindow: function(width, height, redbits, greenbits, bluebits, alphabits, depthbits, stencilbits, mode) {
+ if (width == 0 && height > 0) {
+ width = 4 * height / 3;
+ }
+ if (width > 0 && height == 0) {
+ height = 3 * width / 4;
+ }
+ GLFW.params[0x00020005] = redbits; //GLFW_RED_BITS
+ GLFW.params[0x00020006] = greenbits; //GLFW_GREEN_BITS
+ GLFW.params[0x00020007] = bluebits; //GLFW_BLUE_BITS
+ GLFW.params[0x00020008] = alphabits; //GLFW_ALPHA_BITS
+ GLFW.params[0x00020009] = depthbits; //GLFW_DEPTH_BITS
+ GLFW.params[0x0002000A] = stencilbits; //GLFW_STENCIL_BITS
+
+ if (mode == 0x00010001) {//GLFW_WINDOW
+ Browser.setCanvasSize(GLFW.initWindowWidth = width,
+ GLFW.initWindowHeight = height);
+ GLFW.params[0x00030003] = true; //GLFW_STICKY_MOUSE_BUTTONS
+ }
+ else if (mode == 0x00010002) {//GLFW_FULLSCREEN
+ GLFW.requestFullScreen();
+ GLFW.params[0x00030003] = false; //GLFW_STICKY_MOUSE_BUTTONS
+ }
+ else{
+ throw "Invalid glfwOpenWindow mode.";
+ }
+
+ Module.ctx = Browser.createContext(Module['canvas'], true, true);
+ return 1; //GL_TRUE
+ },
+
+ glfwOpenWindowHint: function(target, hint) {
+ GLFW.params[target] = hint;
+ },
+
+ glfwCloseWindow__deps: ['$Browser'],
+ glfwCloseWindow: function() {
+ if (GLFW.closeFunc) {
+ Runtime.dynCall('v', GLFW.closeFunc, []);
+ }
+ Module.ctx = Browser.destroyContext(Module['canvas'], true, true);
+ },
+
+ glfwSetWindowTitle: function(title) {
+ document.title = Pointer_stringify(title);
+ },
+
+ glfwGetWindowSize: function(width, height) {
+ setValue(width, Module['canvas'].width, 'i32');
+ setValue(height, Module['canvas'].height, 'i32');
+ },
+
+ glfwSetWindowSize: function(width, height) {
+ GLFW.cancelFullScreen();
+ Browser.setCanvasSize(width, height);
+ if (GLFW.resizeFunc) {
+ Runtime.dynCall('vii', GLFW.resizeFunc, [width, height]);
+ }
+ },
+
+ glfwSetWindowPos: function(x, y) {},
+
+ glfwIconifyWindow: function() {},
+
+ glfwRestoreWindow: function() {},
+
+ glfwSwapBuffers: function() {},
+
+ glfwSwapInterval: function(interval) {},
+
+ glfwGetWindowParam: function(param) {
+ return GLFW.params[param];
+ },
+
+ glfwSetWindowSizeCallback: function(cbfun) {
+ GLFW.resizeFunc = cbfun;
+ },
+
+ glfwSetWindowCloseCallback: function(cbfun) {
+ GLFW.closeFunc = cbfun;
+ },
+
+ glfwSetWindowRefreshCallback: function(cbfun) {
+ GLFW.refreshFunc = cbfun;
+ },
+
+ /* Video mode functions */
+ glfwGetVideoModes: function(list, maxcount) { throw "glfwGetVideoModes is not implemented."; },
+
+ glfwGetDesktopMode: function(mode) { throw "glfwGetDesktopMode is not implemented."; },
+
+ /* Input handling */
+ glfwPollEvents: function() {},
+
+ glfwWaitEvents: function() {},
+
+ glfwGetKey: function(key) {
+ return GLFW.keys[key];
+ },
+
+ glfwGetMouseButton: function(button) {
+ return (GLFW.buttons & (1 << button)) > 0;
+ },
+
+ glfwGetMousePos: function(xpos, ypos) {
+ setValue(xpos, GLFW.lastX, 'i32');
+ setValue(ypos, GLFW.lastY, 'i32');
+ },
+
+ //I believe it is not possible to move the mouse with javascript
+ glfwSetMousePos: function(xpos, ypos) {},
+
+ glfwGetMouseWheel: function() {
+ return GLFW.wheelPos;
+ },
+
+ glfwSetMouseWheel: function(pos) {
+ GLFW.wheelPos = pos;
+ },
+
+ glfwSetKeyCallback: function(cbfun) {
+ GLFW.keyFunc = cbfun;
+ },
+
+ glfwSetCharCallback: function(cbfun) {
+ GLFW.charFunc = cbfun;
+ },
+
+ glfwSetMouseButtonCallback: function(cbfun) {
+ GLFW.mouseButtonFunc = cbfun;
+ },
+
+ glfwSetMousePosCallback: function(cbfun) {
+ GLFW.mouseFunc = cbfun;
+ },
+
+ glfwSetMouseWheelCallback: function(cbfun) {
+ GLFW.mouseWheelFunc = cbfun;
+ },
+
+ /* Joystick input */
+ glfwGetJoystickParam: function(joy, param) { throw "glfwGetJoystickParam is not implemented."; },
+
+ glfwGetJoystickPos: function(joy, pos, numaxes) { throw "glfwGetJoystickPos is not implemented."; },
+
+ glfwGetJoystickButtons: function(joy, buttons, numbuttons) { throw "glfwGetJoystickButtons is not implemented."; },
+
+ /* Time */
+ glfwGetTime: function() {
+ return (Date.now()/1000) - GLFW.initTime;
+ },
+
+ glfwSetTime: function(time) {
+ GLFW.initTime = Date.now()/1000 + time;
+ },
+
+ glfwSleep__deps: ['sleep'],
+ glfwSleep: function(time) {
+ _sleep(time);
+ },
+
+ /* Extension support */
+ glfwExtensionSupported: function(extension) {
+ return Module.ctx.getSupportedExtensions().indexOf(Pointer_stringify(extension)) > -1;
+ },
+
+ glfwGetProcAddress__deps: ['glfwGetProcAddress'],
+ glfwGetProcAddress: function(procname) {
+ return _getProcAddress(procname);
+ },
+
+ glfwGetGLVersion: function(major, minor, rev) {
+ setValue(major, 0, 'i32');
+ setValue(minor, 0, 'i32');
+ setValue(rev, 1, 'i32');
+ },
+
+ /* Threading support */
+ glfwCreateThread: function(fun, arg) {
+ var str = 'v';
+ for (var i in arg) {
+ str += 'i';
+ }
+ Runtime.dynCall(str, fun, arg);
+ //One single thread
+ return 0;
+ },
+
+ glfwDestroyThread: function(ID) {},
+
+ glfwWaitThread: function(ID, waitmode) {},
+
+ glfwGetThreadID: function() {
+ //One single thread
+ return 0;
+ },
+
+ glfwCreateMutex: function() { throw "glfwCreateMutex is not implemented."; },
+
+ glfwDestroyMutex: function(mutex) { throw "glfwDestroyMutex is not implemented."; },
+
+ glfwLockMutex: function(mutex) { throw "glfwLockMutex is not implemented."; },
+
+ glfwUnlockMutex: function(mutex) { throw "glfwUnlockMutex is not implemented."; },
+
+ glfwCreateCond: function() { throw "glfwCreateCond is not implemented."; },
+
+ glfwDestroyCond: function(cond) { throw "glfwDestroyCond is not implemented."; },
+
+ glfwWaitCond: function(cond, mutex, timeout) { throw "glfwWaitCond is not implemented."; },
+
+ glfwSignalCond: function(cond) { throw "glfwSignalCond is not implemented."; },
+
+ glfwBroadcastCond: function(cond) { throw "glfwBroadcastCond is not implemented."; },
+
+ glfwGetNumberOfProcessors: function() {
+ //Threads are disabled anyway…
+ return 1;
+ },
+
+ /* Enable/disable functions */
+ glfwEnable: function(token) {
+ GLFW.params[token] = false;
+ },
+
+ glfwDisable: function(token) {
+ GLFW.params[token] = true;
+ },
+
+ /* Image/texture I/O support */
+ glfwReadImage: function(name, img, flags) { throw "glfwReadImage is not implemented."; },
+
+ glfwReadMemoryImage: function(data, size, img, flags) { throw "glfwReadMemoryImage is not implemented."; },
+
+ glfwFreeImage: function(img) { throw "glfwFreeImage is not implemented."; },
+
+ glfwLoadTexture2D: function(name, flags) { throw "glfwLoadTexture2D is not implemented."; },
+
+ glfwLoadMemoryTexture2D: function(data, size, flags) { throw "glfwLoadMemoryTexture2D is not implemented."; },
+
+ glfwLoadTextureImage2D: function(img, flags) { throw "glfwLoadTextureImage2D is not implemented."; },
+};
+
+autoAddDeps(LibraryGLFW, '$GLFW');
+mergeInto(LibraryManager.library, LibraryGLFW);
+
+
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 42207f23..71ab2277 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1032,6 +1032,19 @@ var LibrarySDL = {
return ret;
},
+ rotozoomSurface: function(src, angle, zoom, smooth) {
+ var srcData = SDL.surfaces[src];
+ var w = srcData.width * zoom;
+ var h = srcData.height * zoom;
+ var diagonal = Math.ceil(Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)));
+ var ret = SDL.makeSurface(diagonal, diagonal, srcData.flags, false, 'rotozoomSurface');
+ var dstData = SDL.surfaces[ret];
+ dstData.ctx.translate(diagonal / 2, diagonal / 2);
+ dstData.ctx.rotate(angle * Math.PI / 180);
+ dstData.ctx.drawImage(srcData.canvas, -w / 2, -h / 2, w, h);
+ return ret;
+ },
+
SDL_SetAlpha: function(surf, flag, alpha) {
SDL.surfaces[surf].alpha = alpha;
},
diff --git a/src/modules.js b/src/modules.js
index bda8a605..f2994ada 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -374,7 +374,7 @@ var LibraryManager = {
load: function() {
if (this.library) return;
- var libraries = ['library.js', 'library_browser.js', 'library_sdl.js', 'library_gl.js', 'library_glut.js', 'library_xlib.js', 'library_egl.js', 'library_gc.js', 'library_jansson.js', 'library_openal.js'].concat(additionalLibraries);
+ var libraries = ['library.js', 'library_browser.js', 'library_sdl.js', 'library_gl.js', 'library_glut.js', 'library_xlib.js', 'library_egl.js', 'library_gc.js', 'library_jansson.js', 'library_openal.js', 'library_glfw.js'].concat(additionalLibraries);
for (var i = 0; i < libraries.length; i++) {
eval(processMacros(preprocess(read(libraries[i]))));
}
diff --git a/src/parseTools.js b/src/parseTools.js
index 6818e442..20049094 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1457,7 +1457,44 @@ function makeGetPos(ptr) {
var IHEAP_FHEAP = set('IHEAP', 'IHEAPU', 'FHEAP');
-function makePointer(slab, pos, allocator, type, ptr) {
+var temp64f = new Float64Array(1);
+var temp32f = new Float32Array(temp64f.buffer);
+var temp32 = new Uint32Array(temp64f.buffer);
+var temp16 = new Uint16Array(temp64f.buffer);
+var temp8 = new Uint8Array(temp64f.buffer);
+var memoryInitialization = [];
+
+function writeInt8s(slab, i, value, type) {
+ var currSize;
+ switch (type) {
+ case 'i1':
+ case 'i8': temp8[0] = value; currSize = 1; break;
+ case 'i16': temp16[0] = value; currSize = 2; break;
+ case 'float': temp32f[0] = value; currSize = 4; break;
+ case 'double': temp64f[0] = value; currSize = 8; break;
+ case 'i64': // fall through, i64 is two i32 chunks
+ case 'i32': // fall through, i32 can be a pointer
+ default: {
+ if (type == 'i32' || type == 'i64' || type[type.length-1] == '*') {
+ if (!isNumber(value)) { // function table stuff, etc.
+ slab[i] = value;
+ slab[i+1] = slab[i+2] = slab[i+3] = 0;
+ return 4;
+ }
+ temp32[0] = value;
+ currSize = 4;
+ } else {
+ throw 'what? ' + types[i];
+ }
+ }
+ }
+ for (var j = 0; j < currSize; j++) {
+ slab[i+j] = temp8[j];
+ }
+ return currSize;
+}
+
+function makePointer(slab, pos, allocator, type, ptr, finalMemoryInitialization) {
assert(type, 'makePointer requires type info');
if (typeof slab == 'string' && (slab.substr(0, 4) === 'HEAP' || (USE_TYPED_ARRAYS == 1 && slab in IHEAP_FHEAP))) return pos;
var types = generateStructTypes(type);
@@ -1472,19 +1509,19 @@ function makePointer(slab, pos, allocator, type, ptr) {
}
}
// compress type info and data if possible
- var de;
- try {
- // compress all-zeros into a number (which will become zeros(..)).
- // note that we cannot always eval the slab, e.g., if it contains ident,0,0 etc. In that case, no compression TODO: ensure we get arrays here, not str
- var evaled = typeof slab === 'string' ? eval(slab) : slab;
- de = dedup(evaled);
- if (de.length === 1 && de[0] == 0) {
- slab = types.length;
- }
- // TODO: if not all zeros, at least filter out items with type === 0. requires cleverness to know how to skip at runtime though. also
- // be careful of structure padding
- } catch(e){}
if (USE_TYPED_ARRAYS != 2) {
+ var de;
+ try {
+ // compress all-zeros into a number (which will become zeros(..)).
+ // note that we cannot always eval the slab, e.g., if it contains ident,0,0 etc. In that case, no compression TODO: ensure we get arrays here, not str
+ var evaled = typeof slab === 'string' ? eval(slab) : slab;
+ de = dedup(evaled);
+ if (de.length === 1 && de[0] == 0) {
+ slab = types.length;
+ }
+ // TODO: if not all zeros, at least filter out items with type === 0. requires cleverness to know how to skip at runtime though. also
+ // be careful of structure padding
+ } catch(e){}
de = dedup(types);
if (de.length === 1) {
types = de[0];
@@ -1496,50 +1533,32 @@ function makePointer(slab, pos, allocator, type, ptr) {
}
}
} else { // USE_TYPED_ARRAYS == 2
- var fail = false;
- if (typeof slab === 'object') {
- // flatten out into i8 values, so we can just to typed array .set()
- for (var i = 0; i < slab.length; i++) {
- if (!isNumber(slab[i])) { fail = true; break }
+ if (!finalMemoryInitialization) {
+ // XXX This heavily assumes the target endianness is the same as our current endianness! XXX
+ var i = 0;
+ while (i < slab.length) {
+ var currType = types[i];
+ if (!currType) { i++; continue }
+ i += writeInt8s(slab, i, slab[i], currType);
}
- if (!fail) {
- // XXX This heavily assumes the target endianness is the same as our current endianness! XXX
- var i = 0;
- var temp64f = new Float64Array(1);
- var temp32f = new Float32Array(temp64f.buffer);
- var temp32 = new Uint32Array(temp64f.buffer);
- var temp16 = new Uint16Array(temp64f.buffer);
- var temp8 = new Uint8Array(temp64f.buffer);
- while (i < slab.length) {
- var currType = types[i];
- if (!currType) { i++; continue }
- var currSize = 0, currValue = slab[i];
- switch (currType) {
- case 'i8': i++; continue;
- case 'i16': temp16[0] = currValue; currSize = 2; break;
- case 'i64': // fall through, i64 is two i32 chunks
- case 'i32': temp32[0] = currValue; currSize = 4; break;
- case 'float': temp32f[0] = currValue; currSize = 4; break;
- case 'double': temp64f[0] = currValue; currSize = 8; break;
- default: {
- if (currType[currType.length-1] == '*') {
- temp32[0] = currValue;
- currSize = 4;
- } else {
- throw 'what? ' + types[i];
- }
- }
- }
- for (var j = 0; j < currSize; j++) {
- slab[i+j] = temp8[j];
- }
- i += currSize;
- }
+ types = 'i8';
+ }
+ }
+ if (allocator == 'ALLOC_NONE' && USE_TYPED_ARRAYS == 2) {
+ if (!finalMemoryInitialization) {
+ // writing out into memory, without a normal allocation. We put all of these into a single big chunk.
+ assert(typeof slab == 'object');
+ assert(slab.length % QUANTUM_SIZE == 0, slab.length); // must be aligned already
+ var offset = ptr - TOTAL_STACK; // we assert on GLOBAL_BASE being equal to TOTAL_STACK
+ for (var i = 0; i < slab.length; i++) {
+ memoryInitialization[offset + i] = slab[i];
}
+ return '';
}
- if (!fail) types = 'i8';
+ // This is the final memory initialization
+ types = 'i8';
}
- if (typeof slab == 'object') slab = '[' + slab.join(',') + ']';
+
// JS engines sometimes say array initializers are too large. Work around that by chunking and calling concat to combine at runtime
var chunkSize = 10240;
function chunkify(array) {
@@ -1552,14 +1571,18 @@ function makePointer(slab, pos, allocator, type, ptr) {
}
return ret;
}
- if (typeof slab == 'string' && evaled && evaled.length > chunkSize && slab.length > chunkSize) {
- slab = chunkify(evaled);
+ if (typeof slab == 'object' && slab.length > chunkSize) {
+ slab = chunkify(slab);
+ }
+ if (typeof types == 'object') {
+ while (types.length < slab.length) types.push(0);
}
if (typeof types != 'string' && types.length > chunkSize) {
types = chunkify(types);
} else {
types = JSON.stringify(types);
}
+ if (typeof slab == 'object') slab = '[' + slab.join(',') + ']';
return 'allocate(' + slab + ', ' + types + (allocator ? ', ' + allocator : '') + (allocator == 'ALLOC_NONE' ? ', ' + ptr : '') + ')';
}
@@ -2326,3 +2349,14 @@ function charCode(char) {
return char.charCodeAt(0);
}
+function getTypeFromHeap(suffix) {
+ switch (suffix) {
+ case '8': return 'i8';
+ case '16': return 'i16';
+ case '32': return 'i32';
+ case 'F32': return 'float';
+ case 'F64': return 'double';
+ default: throw 'getTypeFromHeap? ' + suffix;
+ }
+}
+
diff --git a/system/include/GL/glfw.h b/system/include/GL/glfw.h
new file mode 100644
index 00000000..e20552e4
--- /dev/null
+++ b/system/include/GL/glfw.h
@@ -0,0 +1,518 @@
+/************************************************************************
+ * GLFW - An OpenGL framework
+ * API version: 2.7
+ * WWW: http://www.glfw.org/
+ *------------------------------------------------------------------------
+ * Copyright (c) 2002-2006 Marcus Geelnard
+ * Copyright (c) 2006-2010 Camilla Berglund
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would
+ * be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not
+ * be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ *************************************************************************/
+
+#ifndef __glfw_h_
+#define __glfw_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*************************************************************************
+ * Global definitions
+ *************************************************************************/
+
+/* We need a NULL pointer from time to time */
+#ifndef NULL
+ #ifdef __cplusplus
+ #define NULL 0
+ #else
+ #define NULL ((void *)0)
+ #endif
+#endif /* NULL */
+
+
+/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
+
+/* Please report any probles that you find with your compiler, which may
+ * be solved in this section! There are several compilers that I have not
+ * been able to test this file with yet.
+ *
+ * First: If we are we on Windows, we want a single define for it (_WIN32)
+ * (Note: For Cygwin the compiler flag -mwin32 should be used, but to
+ * make sure that things run smoothly for Cygwin users, we add __CYGWIN__
+ * to the list of "valid Win32 identifiers", which removes the need for
+ * -mwin32)
+ */
+#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
+ #define _WIN32
+#endif /* _WIN32 */
+
+/* In order for extension support to be portable, we need to define an
+ * OpenGL function call method. We use the keyword APIENTRY, which is
+ * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)
+ */
+#ifndef APIENTRY
+ #ifdef _WIN32
+ #define APIENTRY __stdcall
+ #else
+ #define APIENTRY
+ #endif
+ #define GL_APIENTRY_DEFINED
+#endif /* APIENTRY */
+
+
+/* The following three defines are here solely to make some Windows-based
+ * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
+ * it has the major drawback of severely polluting our namespace.
+ */
+
+/* Under Windows, we need WINGDIAPI defined */
+#if !defined(WINGDIAPI) && defined(_WIN32)
+ #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
+ /* Microsoft Visual C++, Borland C++ Builder and Pelles C */
+ #define WINGDIAPI __declspec(dllimport)
+ #elif defined(__LCC__)
+ /* LCC-Win32 */
+ #define WINGDIAPI __stdcall
+ #else
+ /* Others (e.g. MinGW, Cygwin) */
+ #define WINGDIAPI extern
+ #endif
+ #define GL_WINGDIAPI_DEFINED
+#endif /* WINGDIAPI */
+
+/* Some <GL/glu.h> files also need CALLBACK defined */
+#if !defined(CALLBACK) && defined(_WIN32)
+ #if defined(_MSC_VER)
+ /* Microsoft Visual C++ */
+ #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
+ #define CALLBACK __stdcall
+ #else
+ #define CALLBACK
+ #endif
+ #else
+ /* Other Windows compilers */
+ #define CALLBACK __stdcall
+ #endif
+ #define GLU_CALLBACK_DEFINED
+#endif /* CALLBACK */
+
+/* Microsoft Visual C++, Borland C++ and Pelles C <GL*glu.h> needs wchar_t */
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED)
+ typedef unsigned short wchar_t;
+ #define _WCHAR_T_DEFINED
+#endif /* _WCHAR_T_DEFINED */
+
+
+/* ---------------- GLFW related system specific defines ----------------- */
+
+#if defined(_WIN32) && defined(GLFW_BUILD_DLL)
+
+ /* We are building a Win32 DLL */
+ #define GLFWAPI __declspec(dllexport)
+ #define GLFWAPIENTRY __stdcall
+ #define GLFWCALL __stdcall
+
+#elif defined(_WIN32) && defined(GLFW_DLL)
+
+ /* We are calling a Win32 DLL */
+ #if defined(__LCC__)
+ #define GLFWAPI extern
+ #else
+ #define GLFWAPI __declspec(dllimport)
+ #endif
+ #define GLFWAPIENTRY __stdcall
+ #define GLFWCALL __stdcall
+
+#else
+
+ /* We are either building/calling a static lib or we are non-win32 */
+ #define GLFWAPIENTRY
+ #define GLFWAPI
+ #define GLFWCALL
+
+#endif
+
+/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
+
+/* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
+ * convenient for the user to only have to include <GL/glfw.h>. This also
+ * solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
+ * special defines which normally requires the user to include <windows.h>
+ * (which is not a nice solution for portable programs).
+ */
+#if defined(__APPLE_CC__)
+ #if defined(GLFW_INCLUDE_GL3)
+ #include <OpenGL/gl3.h>
+ #else
+ #define GL_GLEXT_LEGACY
+ #include <OpenGL/gl.h>
+ #endif
+ #ifndef GLFW_NO_GLU
+ #include <OpenGL/glu.h>
+ #endif
+#else
+ #if defined(GLFW_INCLUDE_GL3)
+ #include <GL3/gl3.h>
+ #else
+ #include <GL/gl.h>
+ #endif
+ #ifndef GLFW_NO_GLU
+ #include <GL/glu.h>
+ #endif
+#endif
+
+
+/*************************************************************************
+ * GLFW version
+ *************************************************************************/
+
+#define GLFW_VERSION_MAJOR 2
+#define GLFW_VERSION_MINOR 7
+#define GLFW_VERSION_REVISION 7
+
+
+/*************************************************************************
+ * Input handling definitions
+ *************************************************************************/
+
+/* Key and button state/action definitions */
+#define GLFW_RELEASE 0
+#define GLFW_PRESS 1
+
+/* Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used
+ * for printable keys (such as A-Z, 0-9 etc), and values above 256
+ * represent special (non-printable) keys (e.g. F1, Page Up etc).
+ */
+#define GLFW_KEY_UNKNOWN -1
+#define GLFW_KEY_SPACE 32
+#define GLFW_KEY_SPECIAL 256
+#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1)
+#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2)
+#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3)
+#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4)
+#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5)
+#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6)
+#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7)
+#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8)
+#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9)
+#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10)
+#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11)
+#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12)
+#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13)
+#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14)
+#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15)
+#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16)
+#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17)
+#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18)
+#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19)
+#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20)
+#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21)
+#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22)
+#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23)
+#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24)
+#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25)
+#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26)
+#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27)
+#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28)
+#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29)
+#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30)
+#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31)
+#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32)
+#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33)
+#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34)
+#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35)
+#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36)
+#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37)
+#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38)
+#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39)
+#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40)
+#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41)
+#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42)
+#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43)
+#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44)
+#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45)
+#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46)
+#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47)
+#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48)
+#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49)
+#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50)
+#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51)
+#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52)
+#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53)
+#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54)
+#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55)
+#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56)
+#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57)
+#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58)
+#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59)
+#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60)
+#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61)
+#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62)
+#define GLFW_KEY_KP_NUM_LOCK (GLFW_KEY_SPECIAL+63)
+#define GLFW_KEY_CAPS_LOCK (GLFW_KEY_SPECIAL+64)
+#define GLFW_KEY_SCROLL_LOCK (GLFW_KEY_SPECIAL+65)
+#define GLFW_KEY_PAUSE (GLFW_KEY_SPECIAL+66)
+#define GLFW_KEY_LSUPER (GLFW_KEY_SPECIAL+67)
+#define GLFW_KEY_RSUPER (GLFW_KEY_SPECIAL+68)
+#define GLFW_KEY_MENU (GLFW_KEY_SPECIAL+69)
+#define GLFW_KEY_LAST GLFW_KEY_MENU
+
+/* Mouse button definitions */
+#define GLFW_MOUSE_BUTTON_1 0
+#define GLFW_MOUSE_BUTTON_2 1
+#define GLFW_MOUSE_BUTTON_3 2
+#define GLFW_MOUSE_BUTTON_4 3
+#define GLFW_MOUSE_BUTTON_5 4
+#define GLFW_MOUSE_BUTTON_6 5
+#define GLFW_MOUSE_BUTTON_7 6
+#define GLFW_MOUSE_BUTTON_8 7
+#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
+
+/* Mouse button aliases */
+#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
+#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
+#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
+
+
+/* Joystick identifiers */
+#define GLFW_JOYSTICK_1 0
+#define GLFW_JOYSTICK_2 1
+#define GLFW_JOYSTICK_3 2
+#define GLFW_JOYSTICK_4 3
+#define GLFW_JOYSTICK_5 4
+#define GLFW_JOYSTICK_6 5
+#define GLFW_JOYSTICK_7 6
+#define GLFW_JOYSTICK_8 7
+#define GLFW_JOYSTICK_9 8
+#define GLFW_JOYSTICK_10 9
+#define GLFW_JOYSTICK_11 10
+#define GLFW_JOYSTICK_12 11
+#define GLFW_JOYSTICK_13 12
+#define GLFW_JOYSTICK_14 13
+#define GLFW_JOYSTICK_15 14
+#define GLFW_JOYSTICK_16 15
+#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
+
+
+/*************************************************************************
+ * Other definitions
+ *************************************************************************/
+
+/* glfwOpenWindow modes */
+#define GLFW_WINDOW 0x00010001
+#define GLFW_FULLSCREEN 0x00010002
+
+/* glfwGetWindowParam tokens */
+#define GLFW_OPENED 0x00020001
+#define GLFW_ACTIVE 0x00020002
+#define GLFW_ICONIFIED 0x00020003
+#define GLFW_ACCELERATED 0x00020004
+#define GLFW_RED_BITS 0x00020005
+#define GLFW_GREEN_BITS 0x00020006
+#define GLFW_BLUE_BITS 0x00020007
+#define GLFW_ALPHA_BITS 0x00020008
+#define GLFW_DEPTH_BITS 0x00020009
+#define GLFW_STENCIL_BITS 0x0002000A
+
+/* The following constants are used for both glfwGetWindowParam
+ * and glfwOpenWindowHint
+ */
+#define GLFW_REFRESH_RATE 0x0002000B
+#define GLFW_ACCUM_RED_BITS 0x0002000C
+#define GLFW_ACCUM_GREEN_BITS 0x0002000D
+#define GLFW_ACCUM_BLUE_BITS 0x0002000E
+#define GLFW_ACCUM_ALPHA_BITS 0x0002000F
+#define GLFW_AUX_BUFFERS 0x00020010
+#define GLFW_STEREO 0x00020011
+#define GLFW_WINDOW_NO_RESIZE 0x00020012
+#define GLFW_FSAA_SAMPLES 0x00020013
+#define GLFW_OPENGL_VERSION_MAJOR 0x00020014
+#define GLFW_OPENGL_VERSION_MINOR 0x00020015
+#define GLFW_OPENGL_FORWARD_COMPAT 0x00020016
+#define GLFW_OPENGL_DEBUG_CONTEXT 0x00020017
+#define GLFW_OPENGL_PROFILE 0x00020018
+
+/* GLFW_OPENGL_PROFILE tokens */
+#define GLFW_OPENGL_CORE_PROFILE 0x00050001
+#define GLFW_OPENGL_COMPAT_PROFILE 0x00050002
+
+/* glfwEnable/glfwDisable tokens */
+#define GLFW_MOUSE_CURSOR 0x00030001
+#define GLFW_STICKY_KEYS 0x00030002
+#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
+#define GLFW_SYSTEM_KEYS 0x00030004
+#define GLFW_KEY_REPEAT 0x00030005
+#define GLFW_AUTO_POLL_EVENTS 0x00030006
+
+/* glfwWaitThread wait modes */
+#define GLFW_WAIT 0x00040001
+#define GLFW_NOWAIT 0x00040002
+
+/* glfwGetJoystickParam tokens */
+#define GLFW_PRESENT 0x00050001
+#define GLFW_AXES 0x00050002
+#define GLFW_BUTTONS 0x00050003
+
+/* glfwReadImage/glfwLoadTexture2D flags */
+#define GLFW_NO_RESCALE_BIT 0x00000001 /* Only for glfwReadImage */
+#define GLFW_ORIGIN_UL_BIT 0x00000002
+#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 /* Only for glfwLoadTexture2D */
+#define GLFW_ALPHA_MAP_BIT 0x00000008
+
+/* Time spans longer than this (seconds) are considered to be infinity */
+#define GLFW_INFINITY 100000.0
+
+
+/*************************************************************************
+ * Typedefs
+ *************************************************************************/
+
+/* The video mode structure used by glfwGetVideoModes() */
+typedef struct {
+ int Width, Height;
+ int RedBits, BlueBits, GreenBits;
+} GLFWvidmode;
+
+/* Image/texture information */
+typedef struct {
+ int Width, Height;
+ int Format;
+ int BytesPerPixel;
+ unsigned char *Data;
+} GLFWimage;
+
+/* Thread ID */
+typedef int GLFWthread;
+
+/* Mutex object */
+typedef void * GLFWmutex;
+
+/* Condition variable object */
+typedef void * GLFWcond;
+
+/* Function pointer types */
+typedef void (GLFWCALL * GLFWwindowsizefun)(int,int);
+typedef int (GLFWCALL * GLFWwindowclosefun)(void);
+typedef void (GLFWCALL * GLFWwindowrefreshfun)(void);
+typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int);
+typedef void (GLFWCALL * GLFWmouseposfun)(int,int);
+typedef void (GLFWCALL * GLFWmousewheelfun)(int);
+typedef void (GLFWCALL * GLFWkeyfun)(int,int);
+typedef void (GLFWCALL * GLFWcharfun)(int,int);
+typedef void (GLFWCALL * GLFWthreadfun)(void *);
+
+
+/*************************************************************************
+ * Prototypes
+ *************************************************************************/
+
+/* GLFW initialization, termination and version querying */
+GLFWAPI int GLFWAPIENTRY glfwInit( void );
+GLFWAPI void GLFWAPIENTRY glfwTerminate( void );
+GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev );
+
+/* Window handling */
+GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode );
+GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint );
+GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title );
+GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y );
+GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void );
+GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void );
+GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void );
+GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval );
+GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun );
+
+/* Video mode functions */
+GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount );
+GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode );
+
+/* Input handling */
+GLFWAPI void GLFWAPIENTRY glfwPollEvents( void );
+GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void );
+GLFWAPI int GLFWAPIENTRY glfwGetKey( int key );
+GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button );
+GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos );
+GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos );
+GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void );
+GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos );
+GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun );
+GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun );
+
+/* Joystick input */
+GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param );
+GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes );
+GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons );
+
+/* Time */
+GLFWAPI double GLFWAPIENTRY glfwGetTime( void );
+GLFWAPI void GLFWAPIENTRY glfwSetTime( double time );
+GLFWAPI void GLFWAPIENTRY glfwSleep( double time );
+
+/* Extension support */
+GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension );
+GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname );
+GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev );
+
+/* Threading support */
+GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg );
+GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID );
+GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode );
+GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void );
+GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void );
+GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex );
+GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex );
+GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex );
+GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void );
+GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond );
+GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout );
+GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond );
+GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond );
+GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void );
+
+/* Enable/disable functions */
+GLFWAPI void GLFWAPIENTRY glfwEnable( int token );
+GLFWAPI void GLFWAPIENTRY glfwDisable( int token );
+
+/* Image/texture I/O support */
+GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags );
+GLFWAPI int GLFWAPIENTRY glfwReadMemoryImage( const void *data, long size, GLFWimage *img, int flags );
+GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img );
+GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags );
+GLFWAPI int GLFWAPIENTRY glfwLoadMemoryTexture2D( const void *data, long size, int flags );
+GLFWAPI int GLFWAPIENTRY glfwLoadTextureImage2D( GLFWimage *img, int flags );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glfw_h_ */
+
diff --git a/system/include/libcxx/__bit_reference b/system/include/libcxx/__bit_reference
index 8180295b..1621deb8 100644
--- a/system/include/libcxx/__bit_reference
+++ b/system/include/libcxx/__bit_reference
@@ -81,6 +81,16 @@ class __bit_reference<_Cp, false>
{
};
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
template <class _Cp, class _Dp>
_LIBCPP_INLINE_VISIBILITY inline
void
diff --git a/system/include/libcxx/__config b/system/include/libcxx/__config
index 8617b866..959390d5 100644
--- a/system/include/libcxx/__config
+++ b/system/include/libcxx/__config
@@ -11,7 +11,7 @@
#ifndef _LIBCPP_CONFIG
#define _LIBCPP_CONFIG
-#if !_MSC_VER // explicit macro necessary because it is only defined below in this file
+#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file
#pragma GCC system_header
#endif
@@ -96,24 +96,27 @@
# endif
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
-#if _WIN32
+#ifdef _WIN32
// only really useful for a DLL
#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
# ifdef cxx_EXPORTS
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE __declspec(dllexport)
+# define _LIBCPP_FUNC_VIS __declspec(dllexport)
+# define _LIBCPP_TYPE_VIS __declspec(dllexport)
# else
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE __declspec(dllimport)
+# define _LIBCPP_FUNC_VIS __declspec(dllimport)
+# define _LIBCPP_TYPE_VIS __declspec(dllimport)
# endif
#else
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE
+# define _LIBCPP_FUNC_VIS
+# define _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_INLINE_VISIBILITY
-# if _MSC_VER
+# ifdef _MSC_VER
# define _LIBCPP_INLINE_VISIBILITY __forceinline
# else // MinGW GCC and Clang
# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
@@ -121,11 +124,11 @@
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_ALWAYS_INLINE
-# if _MSC_VER
+# ifdef _MSC_VER
# define _LIBCPP_ALWAYS_INLINE __forceinline
# endif
#endif
@@ -136,8 +139,16 @@
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
#endif
-#ifndef _LIBCPP_VISIBLE
-#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default")))
+#ifndef _LIBCPP_FUNC_VIS
+#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
+#endif
+
+#ifndef _LIBCPP_TYPE_VIS
+# if __has_attribute(type_visibility)
+# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
+# endif
#endif
#ifndef _LIBCPP_INLINE_VISIBILITY
@@ -145,7 +156,7 @@
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_CANTTHROW
@@ -261,7 +272,7 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_CONSTEXPR
#endif
-#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
+#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
#endif
@@ -424,7 +435,7 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
__lx __v_; \
_LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
@@ -432,7 +443,7 @@ template <unsigned> struct __static_assert_check {};
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
};
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
@@ -440,18 +451,18 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
-#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
-#if __FreeBSD__
+#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
-#if __APPLE__ || __FreeBSD__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
#endif
-#if __APPLE__ || __FreeBSD__ || __sun__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
#define _LIBCPP_WCTYPE_IS_MASK
#endif
diff --git a/system/include/libcxx/__debug b/system/include/libcxx/__debug
index 4a0e3cec..0d631bf0 100644
--- a/system/include/libcxx/__debug
+++ b/system/include/libcxx/__debug
@@ -16,7 +16,9 @@
# include <cstdlib>
# include <cstdio>
# include <cstddef>
-# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
+# ifndef _LIBCPP_ASSERT
+# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
+# endif
#endif
@@ -24,9 +26,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_VISIBLE __c_node;
+struct _LIBCPP_TYPE_VIS __c_node;
-struct _LIBCPP_VISIBLE __i_node
+struct _LIBCPP_TYPE_VIS __i_node
{
void* __i_;
__i_node* __next_;
@@ -40,7 +42,7 @@ struct _LIBCPP_VISIBLE __i_node
~__i_node();
};
-struct _LIBCPP_VISIBLE __c_node
+struct _LIBCPP_TYPE_VIS __c_node
{
void* __c_;
__c_node* __next_;
@@ -117,7 +119,7 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
return _Cp->__subscriptable(__j, __n);
}
-class _LIBCPP_VISIBLE __libcpp_db
+class _LIBCPP_TYPE_VIS __libcpp_db
{
__c_node** __cbeg_;
__c_node** __cend_;
@@ -176,11 +178,11 @@ private:
_LIBCPP_HIDDEN
__i_node* __find_iterator(const void* __i) const;
- friend _LIBCPP_VISIBLE __libcpp_db* __get_db();
+ friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
};
-_LIBCPP_VISIBLE __libcpp_db* __get_db();
-_LIBCPP_VISIBLE const __libcpp_db* __get_const_db();
+_LIBCPP_FUNC_VIS __libcpp_db* __get_db();
+_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
_LIBCPP_END_NAMESPACE_STD
diff --git a/system/include/libcxx/__functional_03 b/system/include/libcxx/__functional_03
index 3a5397d8..b52d6926 100644
--- a/system/include/libcxx/__functional_03
+++ b/system/include/libcxx/__functional_03
@@ -203,7 +203,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
{
};
-template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
+template<class _Fp> class _LIBCPP_TYPE_VIS function; // undefined
namespace __function
{
@@ -644,7 +644,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const
} // __function
template<class _Rp>
-class _LIBCPP_VISIBLE function<_Rp()>
+class _LIBCPP_TYPE_VIS function<_Rp()>
{
typedef __function::__base<_Rp()> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -928,7 +928,7 @@ function<_Rp()>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0>
-class _LIBCPP_VISIBLE function<_Rp(_A0)>
+class _LIBCPP_TYPE_VIS function<_Rp(_A0)>
: public unary_function<_A0, _Rp>
{
typedef __function::__base<_Rp(_A0)> __base;
@@ -1230,7 +1230,7 @@ function<_Rp(_A0)>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0, class _A1>
-class _LIBCPP_VISIBLE function<_Rp(_A0, _A1)>
+class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1)>
: public binary_function<_A0, _A1, _Rp>
{
typedef __function::__base<_Rp(_A0, _A1)> __base;
@@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1)>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0, class _A1, class _A2>
-class _LIBCPP_VISIBLE function<_Rp(_A0, _A1, _A2)>
+class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1, _A2)>
{
typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -1860,11 +1860,11 @@ swap(function<_Fp>& __x, function<_Fp>& __y)
{return __x.swap(__y);}
template<class _Tp> struct __is_bind_expression : public false_type {};
-template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
+template<class _Tp> struct _LIBCPP_TYPE_VIS is_bind_expression
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
-template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
+template<class _Tp> struct _LIBCPP_TYPE_VIS is_placeholder
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
namespace placeholders
diff --git a/system/include/libcxx/__functional_base b/system/include/libcxx/__functional_base
index 2385459c..40a63a85 100644
--- a/system/include/libcxx/__functional_base
+++ b/system/include/libcxx/__functional_base
@@ -23,21 +23,21 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Arg, class _Result>
-struct _LIBCPP_VISIBLE unary_function
+struct _LIBCPP_TYPE_VIS unary_function
{
typedef _Arg argument_type;
typedef _Result result_type;
};
template <class _Arg1, class _Arg2, class _Result>
-struct _LIBCPP_VISIBLE binary_function
+struct _LIBCPP_TYPE_VIS binary_function
{
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
-template <class _Tp> struct _LIBCPP_VISIBLE hash;
+template <class _Tp> struct _LIBCPP_TYPE_VIS hash;
template <class _Tp>
struct __has_result_type
@@ -51,7 +51,7 @@ public:
};
template <class _Tp>
-struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS less : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x < __y;}
@@ -348,7 +348,7 @@ struct __invoke_return
};
template <class _Tp>
-class _LIBCPP_VISIBLE reference_wrapper
+class _LIBCPP_TYPE_VIS reference_wrapper
: public __weak_result_type<_Tp>
{
public:
diff --git a/system/include/libcxx/__functional_base_03 b/system/include/libcxx/__functional_base_03
index a1005bf7..11165a96 100644
--- a/system/include/libcxx/__functional_base_03
+++ b/system/include/libcxx/__functional_base_03
@@ -996,7 +996,7 @@ struct __invoke_return2
};
template <class _Tp>
-class _LIBCPP_VISIBLE reference_wrapper
+class _LIBCPP_TYPE_VIS reference_wrapper
: public __weak_result_type<_Tp>
{
public:
diff --git a/system/include/libcxx/__hash_table b/system/include/libcxx/__hash_table
index ba04b3e5..6f6050d3 100644
--- a/system/include/libcxx/__hash_table
+++ b/system/include/libcxx/__hash_table
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
size_t __next_prime(size_t __n);
template <class _NodePtr>
@@ -80,14 +80,14 @@ __next_pow2(size_t __n)
}
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
-template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_iterator;
-template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_iterator;
-template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_const_iterator;
+template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS __hash_const_iterator;
+template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_iterator;
+template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
- class _LIBCPP_VISIBLE unordered_map;
+ class _LIBCPP_TYPE_VIS unordered_map;
template <class _NodePtr>
-class _LIBCPP_VISIBLE __hash_iterator
+class _LIBCPP_TYPE_VIS __hash_iterator
{
typedef _NodePtr __node_pointer;
@@ -142,14 +142,14 @@ private:
{}
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
};
template <class _ConstNodePtr>
-class _LIBCPP_VISIBLE __hash_const_iterator
+class _LIBCPP_TYPE_VIS __hash_const_iterator
{
typedef _ConstNodePtr __node_pointer;
@@ -220,15 +220,15 @@ private:
{}
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
};
-template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_local_iterator;
+template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
template <class _NodePtr>
-class _LIBCPP_VISIBLE __hash_local_iterator
+class _LIBCPP_TYPE_VIS __hash_local_iterator
{
typedef _NodePtr __node_pointer;
@@ -294,12 +294,12 @@ private:
}
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_iterator;
};
template <class _ConstNodePtr>
-class _LIBCPP_VISIBLE __hash_const_local_iterator
+class _LIBCPP_TYPE_VIS __hash_const_local_iterator
{
typedef _ConstNodePtr __node_pointer;
@@ -384,7 +384,7 @@ private:
}
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
};
template <class _Alloc>
diff --git a/system/include/libcxx/__locale b/system/include/libcxx/__locale
index 0805ad86..24d565b6 100644
--- a/system/include/libcxx/__locale
+++ b/system/include/libcxx/__locale
@@ -19,11 +19,11 @@
#include <cstdint>
#include <cctype>
#include <locale.h>
-#if _WIN32
+#ifdef _WIN32
# include <support/win32/locale_win32.h>
-#elif (__GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || EMSCRIPTEN)
+#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)) || defined(EMSCRIPTEN)
# include <xlocale.h>
-#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || EMSCRIPTEN
+#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || EMSCRIPTEN
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -31,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE locale;
+class _LIBCPP_TYPE_VIS locale;
template <class _Facet>
_LIBCPP_INLINE_VISIBILITY
@@ -43,12 +43,12 @@ _LIBCPP_INLINE_VISIBILITY
const _Facet&
use_facet(const locale&);
-class _LIBCPP_VISIBLE locale
+class _LIBCPP_TYPE_VIS locale
{
public:
// types:
- class _LIBCPP_VISIBLE facet;
- class _LIBCPP_VISIBLE id;
+ class _LIBCPP_TYPE_VIS facet;
+ class _LIBCPP_TYPE_VIS id;
typedef int category;
static const category // values assigned here are for exposition only
@@ -103,7 +103,7 @@ private:
template <class _Facet> friend const _Facet& use_facet(const locale&);
};
-class _LIBCPP_VISIBLE locale::facet
+class _LIBCPP_TYPE_VIS locale::facet
: public __shared_count
{
protected:
@@ -119,7 +119,7 @@ private:
virtual void __on_zero_shared() _NOEXCEPT;
};
-class _LIBCPP_VISIBLE locale::id
+class _LIBCPP_TYPE_VIS locale::id
{
once_flag __flag_;
int32_t __id_;
@@ -175,7 +175,7 @@ use_facet(const locale& __l)
// template <class _CharT> class collate;
template <class _CharT>
-class _LIBCPP_VISIBLE collate
+class _LIBCPP_TYPE_VIS collate
: public locale::facet
{
public:
@@ -254,15 +254,15 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
return static_cast<long>(__h);
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate<wchar_t>)
// template <class CharT> class collate_byname;
-template <class _CharT> class _LIBCPP_VISIBLE collate_byname;
+template <class _CharT> class _LIBCPP_TYPE_VIS collate_byname;
template <>
-class _LIBCPP_VISIBLE collate_byname<char>
+class _LIBCPP_TYPE_VIS collate_byname<char>
: public collate<char>
{
locale_t __l;
@@ -281,7 +281,7 @@ protected:
};
template <>
-class _LIBCPP_VISIBLE collate_byname<wchar_t>
+class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
: public collate<wchar_t>
{
locale_t __l;
@@ -312,10 +312,10 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
// template <class charT> class ctype
-class _LIBCPP_VISIBLE ctype_base
+class _LIBCPP_TYPE_VIS ctype_base
{
public:
-#if __GLIBC__
+#ifdef __GLIBC__
typedef unsigned short mask;
static const mask space = _ISspace;
static const mask print = _ISprint;
@@ -327,7 +327,7 @@ public:
static const mask punct = _ISpunct;
static const mask xdigit = _ISxdigit;
static const mask blank = _ISblank;
-#elif _WIN32
+#elif defined(_WIN32)
typedef unsigned short mask;
static const mask space = _SPACE;
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
@@ -339,12 +339,12 @@ public:
static const mask punct = _PUNCT;
static const mask xdigit = _HEX;
static const mask blank = _BLANK;
-#elif (__APPLE__ || __FreeBSD__ || EMSCRIPTEN)
-#if __APPLE__
+#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN)
+#ifdef __APPLE__
typedef __uint32_t mask;
-#elif __FreeBSD__
+#elif defined(__FreeBSD__)
typedef unsigned long mask;
-#elif EMSCRIPTEN
+#elif defined(EMSCRIPTEN)
typedef unsigned short mask;
#endif
static const mask space = _CTYPE_S;
@@ -357,7 +357,7 @@ public:
static const mask punct = _CTYPE_P;
static const mask xdigit = _CTYPE_X;
static const mask blank = _CTYPE_B;
-#elif __sun__
+#elif defined(__sun__)
typedef unsigned int mask;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
@@ -388,10 +388,10 @@ public:
_LIBCPP_ALWAYS_INLINE ctype_base() {}
};
-template <class _CharT> class _LIBCPP_VISIBLE ctype;
+template <class _CharT> class _LIBCPP_TYPE_VIS ctype;
template <>
-class _LIBCPP_VISIBLE ctype<wchar_t>
+class _LIBCPP_TYPE_VIS ctype<wchar_t>
: public locale::facet,
public ctype_base
{
@@ -493,7 +493,7 @@ protected:
};
template <>
-class _LIBCPP_VISIBLE ctype<char>
+class _LIBCPP_TYPE_VIS ctype<char>
: public locale::facet, public ctype_base
{
const mask* __tab_;
@@ -611,10 +611,10 @@ protected:
// template <class CharT> class ctype_byname;
-template <class _CharT> class _LIBCPP_VISIBLE ctype_byname;
+template <class _CharT> class _LIBCPP_TYPE_VIS ctype_byname;
template <>
-class _LIBCPP_VISIBLE ctype_byname<char>
+class _LIBCPP_TYPE_VIS ctype_byname<char>
: public ctype<char>
{
locale_t __l;
@@ -632,7 +632,7 @@ protected:
};
template <>
-class _LIBCPP_VISIBLE ctype_byname<wchar_t>
+class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
: public ctype<wchar_t>
{
locale_t __l;
@@ -763,7 +763,7 @@ tolower(_CharT __c, const locale& __loc)
// codecvt_base
-class _LIBCPP_VISIBLE codecvt_base
+class _LIBCPP_TYPE_VIS codecvt_base
{
public:
_LIBCPP_ALWAYS_INLINE codecvt_base() {}
@@ -772,12 +772,12 @@ public:
// template <class internT, class externT, class stateT> class codecvt;
-template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_VISIBLE codecvt;
+template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TYPE_VIS codecvt;
// template <> class codecvt<char, char, mbstate_t>
template <>
-class _LIBCPP_VISIBLE codecvt<char, char, mbstate_t>
+class _LIBCPP_TYPE_VIS codecvt<char, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -863,7 +863,7 @@ protected:
// template <> class codecvt<wchar_t, char, mbstate_t>
template <>
-class _LIBCPP_VISIBLE codecvt<wchar_t, char, mbstate_t>
+class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -946,7 +946,7 @@ protected:
// template <> class codecvt<char16_t, char, mbstate_t>
template <>
-class _LIBCPP_VISIBLE codecvt<char16_t, char, mbstate_t>
+class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1032,7 +1032,7 @@ protected:
// template <> class codecvt<char32_t, char, mbstate_t>
template <>
-class _LIBCPP_VISIBLE codecvt<char32_t, char, mbstate_t>
+class _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1118,7 +1118,7 @@ protected:
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
template <class _InternT, class _ExternT, class _StateT>
-class _LIBCPP_VISIBLE codecvt_byname
+class _LIBCPP_TYPE_VIS codecvt_byname
: public codecvt<_InternT, _ExternT, _StateT>
{
public:
@@ -1142,7 +1142,7 @@ _LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<wchar_t, char, mbstate_t>)
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char16_t, char, mbstate_t>)
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char32_t, char, mbstate_t>)
-_LIBCPP_VISIBLE void __throw_runtime_error(const char*);
+_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
template <size_t _Np>
struct __narrow_to_utf8
@@ -1326,10 +1326,10 @@ struct __widen_from_utf8<32>
// template <class charT> class numpunct
-template <class _CharT> class _LIBCPP_VISIBLE numpunct;
+template <class _CharT> class _LIBCPP_TYPE_VIS numpunct;
template <>
-class _LIBCPP_VISIBLE numpunct<char>
+class _LIBCPP_TYPE_VIS numpunct<char>
: public locale::facet
{
public:
@@ -1360,7 +1360,7 @@ protected:
};
template <>
-class _LIBCPP_VISIBLE numpunct<wchar_t>
+class _LIBCPP_TYPE_VIS numpunct<wchar_t>
: public locale::facet
{
public:
@@ -1392,10 +1392,10 @@ protected:
// template <class charT> class numpunct_byname
-template <class charT> class _LIBCPP_VISIBLE numpunct_byname;
+template <class charT> class _LIBCPP_TYPE_VIS numpunct_byname;
template <>
-class _LIBCPP_VISIBLE numpunct_byname<char>
+class _LIBCPP_TYPE_VIS numpunct_byname<char>
: public numpunct<char>
{
public:
@@ -1413,7 +1413,7 @@ private:
};
template <>
-class _LIBCPP_VISIBLE numpunct_byname<wchar_t>
+class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t>
: public numpunct<wchar_t>
{
public:
diff --git a/system/include/libcxx/__mutex_base b/system/include/libcxx/__mutex_base
index e936ad30..0583df93 100644
--- a/system/include/libcxx/__mutex_base
+++ b/system/include/libcxx/__mutex_base
@@ -32,7 +32,7 @@ template <class _Mutex> class upgrade_lock;
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE mutex
+class _LIBCPP_TYPE_VIS mutex
{
pthread_mutex_t __m_;
@@ -58,9 +58,9 @@ public:
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
};
-struct _LIBCPP_VISIBLE defer_lock_t {};
-struct _LIBCPP_VISIBLE try_to_lock_t {};
-struct _LIBCPP_VISIBLE adopt_lock_t {};
+struct _LIBCPP_TYPE_VIS defer_lock_t {};
+struct _LIBCPP_TYPE_VIS try_to_lock_t {};
+struct _LIBCPP_TYPE_VIS adopt_lock_t {};
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
@@ -77,7 +77,7 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
#endif
template <class _Mutex>
-class _LIBCPP_VISIBLE lock_guard
+class _LIBCPP_TYPE_VIS lock_guard
{
public:
typedef _Mutex mutex_type;
@@ -101,7 +101,7 @@ private:
};
template <class _Mutex>
-class _LIBCPP_VISIBLE unique_lock
+class _LIBCPP_TYPE_VIS unique_lock
{
public:
typedef _Mutex mutex_type;
@@ -285,7 +285,7 @@ void
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
{__x.swap(__y);}
-struct _LIBCPP_VISIBLE cv_status
+struct _LIBCPP_TYPE_VIS cv_status
{
enum __lx {
no_timeout,
@@ -299,7 +299,7 @@ struct _LIBCPP_VISIBLE cv_status
};
-class _LIBCPP_VISIBLE condition_variable
+class _LIBCPP_TYPE_VIS condition_variable
{
pthread_cond_t __cv_;
public:
diff --git a/system/include/libcxx/__std_stream b/system/include/libcxx/__std_stream
index e562e2c4..8ca413eb 100644
--- a/system/include/libcxx/__std_stream
+++ b/system/include/libcxx/__std_stream
@@ -41,7 +41,7 @@ public:
typedef typename traits_type::off_type off_type;
typedef typename traits_type::state_type state_type;
- explicit __stdinbuf(FILE* __fp);
+ __stdinbuf(FILE* __fp, state_type* __st);
protected:
virtual int_type underflow();
@@ -53,7 +53,7 @@ private:
FILE* __file_;
const codecvt<char_type, char, state_type>* __cv_;
- state_type __st_;
+ state_type* __st_;
int __encoding_;
bool __always_noconv_;
@@ -64,9 +64,9 @@ private:
};
template <class _CharT>
-__stdinbuf<_CharT>::__stdinbuf(FILE* __fp)
+__stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
: __file_(__fp),
- __st_()
+ __st_(__st)
{
imbue(this->getloc());
}
@@ -119,15 +119,15 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
codecvt_base::result __r;
do
{
- state_type __sv_st = __st_;
- __r = __cv_->in(__st_, __extbuf, __extbuf + __nread, __enxt,
+ state_type __sv_st = *__st_;
+ __r = __cv_->in(*__st_, __extbuf, __extbuf + __nread, __enxt,
&__1buf, &__1buf + 1, __inxt);
switch (__r)
{
case _VSTD::codecvt_base::ok:
break;
case codecvt_base::partial:
- __st_ = __sv_st;
+ *__st_ = __sv_st;
if (__nread == sizeof(__extbuf))
return traits_type::eof();
{
@@ -150,7 +150,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
{
for (int __i = __nread; __i > 0;)
{
- if (ungetc(__extbuf[--__i], __file_) == EOF)
+ if (ungetc(traits_type::to_int_type(__extbuf[--__i]), __file_) == EOF)
return traits_type::eof();
}
}
@@ -167,7 +167,7 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
char* __enxt;
const char_type __ci = traits_type::to_char_type(__c);
const char_type* __inxt;
- switch (__cv_->out(__st_, &__ci, &__ci + 1, __inxt,
+ switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
{
case _VSTD::codecvt_base::ok:
@@ -200,7 +200,7 @@ public:
typedef typename traits_type::off_type off_type;
typedef typename traits_type::state_type state_type;
- explicit __stdoutbuf(FILE* __fp);
+ __stdoutbuf(FILE* __fp, state_type* __st);
protected:
virtual int_type overflow (int_type __c = traits_type::eof());
@@ -210,7 +210,7 @@ protected:
private:
FILE* __file_;
const codecvt<char_type, char, state_type>* __cv_;
- state_type __st_;
+ state_type* __st_;
bool __always_noconv_;
__stdoutbuf(const __stdoutbuf&);
@@ -218,10 +218,10 @@ private:
};
template <class _CharT>
-__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp)
+__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
: __file_(__fp),
__cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
- __st_(),
+ __st_(__st),
__always_noconv_(__cv_->always_noconv())
{
}
@@ -249,7 +249,7 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
do
{
const char_type* __e;
- __r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
+ __r = __cv_->out(*__st_, this->pbase(), this->pptr(), __e,
__extbuf,
__extbuf + sizeof(__extbuf),
__extbe);
@@ -289,7 +289,7 @@ __stdoutbuf<_CharT>::sync()
do
{
char* __extbe;
- __r = __cv_->unshift(__st_, __extbuf,
+ __r = __cv_->unshift(*__st_, __extbuf,
__extbuf + sizeof(__extbuf),
__extbe);
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
diff --git a/system/include/libcxx/__tree b/system/include/libcxx/__tree
index bd38b4f2..cd6d7efa 100644
--- a/system/include/libcxx/__tree
+++ b/system/include/libcxx/__tree
@@ -25,17 +25,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Compare, class _Allocator> class __tree;
template <class _Tp, class _NodePtr, class _DiffType>
- class _LIBCPP_VISIBLE __tree_iterator;
+ class _LIBCPP_TYPE_VIS __tree_iterator;
template <class _Tp, class _ConstNodePtr, class _DiffType>
- class _LIBCPP_VISIBLE __tree_const_iterator;
+ class _LIBCPP_TYPE_VIS __tree_const_iterator;
template <class _Key, class _Tp, class _Compare, class _Allocator>
- class _LIBCPP_VISIBLE map;
+ class _LIBCPP_TYPE_VIS map;
template <class _Key, class _Tp, class _Compare, class _Allocator>
- class _LIBCPP_VISIBLE multimap;
+ class _LIBCPP_TYPE_VIS multimap;
template <class _Key, class _Compare, class _Allocator>
- class _LIBCPP_VISIBLE set;
+ class _LIBCPP_TYPE_VIS set;
template <class _Key, class _Compare, class _Allocator>
- class _LIBCPP_VISIBLE multiset;
+ class _LIBCPP_TYPE_VIS multiset;
/*
@@ -614,11 +614,11 @@ public:
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
};
-template <class _TreeIterator> class _LIBCPP_VISIBLE __map_iterator;
-template <class _TreeIterator> class _LIBCPP_VISIBLE __map_const_iterator;
+template <class _TreeIterator> class _LIBCPP_TYPE_VIS __map_iterator;
+template <class _TreeIterator> class _LIBCPP_TYPE_VIS __map_const_iterator;
template <class _Tp, class _NodePtr, class _DiffType>
-class _LIBCPP_VISIBLE __tree_iterator
+class _LIBCPP_TYPE_VIS __tree_iterator
{
typedef _NodePtr __node_pointer;
typedef typename pointer_traits<__node_pointer>::element_type __node;
@@ -673,16 +673,16 @@ private:
_LIBCPP_INLINE_VISIBILITY
explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
template <class, class, class> friend class __tree;
- template <class, class, class> friend class _LIBCPP_VISIBLE __tree_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __map_iterator;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
- template <class, class, class> friend class _LIBCPP_VISIBLE set;
- template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS __tree_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __map_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS set;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS multiset;
};
template <class _Tp, class _ConstNodePtr, class _DiffType>
-class _LIBCPP_VISIBLE __tree_const_iterator
+class _LIBCPP_TYPE_VIS __tree_const_iterator
{
typedef _ConstNodePtr __node_pointer;
typedef typename pointer_traits<__node_pointer>::element_type __node;
@@ -759,11 +759,11 @@ private:
explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
: __ptr_(__p) {}
template <class, class, class> friend class __tree;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
- template <class, class, class> friend class _LIBCPP_VISIBLE set;
- template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
- template <class> friend class _LIBCPP_VISIBLE __map_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS set;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS multiset;
+ template <class> friend class _LIBCPP_TYPE_VIS __map_const_iterator;
};
template <class _Tp, class _Compare, class _Allocator>
diff --git a/system/include/libcxx/__tuple b/system/include/libcxx/__tuple
index 1fa90a00..1213262d 100644
--- a/system/include/libcxx/__tuple
+++ b/system/include/libcxx/__tuple
@@ -27,46 +27,46 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
+template <class _Tp> class _LIBCPP_TYPE_VIS tuple_size;
template <class _Tp>
-class _LIBCPP_VISIBLE tuple_size<const _Tp>
+class _LIBCPP_TYPE_VIS tuple_size<const _Tp>
: public tuple_size<_Tp> {};
template <class _Tp>
-class _LIBCPP_VISIBLE tuple_size<volatile _Tp>
+class _LIBCPP_TYPE_VIS tuple_size<volatile _Tp>
: public tuple_size<_Tp> {};
template <class _Tp>
-class _LIBCPP_VISIBLE tuple_size<const volatile _Tp>
+class _LIBCPP_TYPE_VIS tuple_size<const volatile _Tp>
: public tuple_size<_Tp> {};
-template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
+template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS tuple_element;
template <size_t _Ip, class _Tp>
-class _LIBCPP_VISIBLE tuple_element<_Ip, const _Tp>
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, const _Tp>
{
public:
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
};
template <size_t _Ip, class _Tp>
-class _LIBCPP_VISIBLE tuple_element<_Ip, volatile _Tp>
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, volatile _Tp>
{
public:
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
};
template <size_t _Ip, class _Tp>
-class _LIBCPP_VISIBLE tuple_element<_Ip, const volatile _Tp>
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, const volatile _Tp>
{
public:
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
};
-template <class ..._Tp> class _LIBCPP_VISIBLE tuple;
-template <class _T1, class _T2> struct _LIBCPP_VISIBLE pair;
-template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array;
+template <class ..._Tp> class _LIBCPP_TYPE_VIS tuple;
+template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS pair;
+template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS array;
template <class _Tp> struct __tuple_like : false_type {};
@@ -154,7 +154,7 @@ struct __make_tuple_indices
template <class ..._Tp> struct __tuple_types {};
template <size_t _Ip>
-class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<> >
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, __tuple_types<> >
{
public:
static_assert(_Ip == 0, "tuple_element index out of range");
@@ -162,21 +162,21 @@ public:
};
template <class _Hp, class ..._Tp>
-class _LIBCPP_VISIBLE tuple_element<0, __tuple_types<_Hp, _Tp...> >
+class _LIBCPP_TYPE_VIS tuple_element<0, __tuple_types<_Hp, _Tp...> >
{
public:
typedef _Hp type;
};
template <size_t _Ip, class _Hp, class ..._Tp>
-class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
{
public:
typedef typename tuple_element<_Ip-1, __tuple_types<_Tp...> >::type type;
};
template <class ..._Tp>
-class _LIBCPP_VISIBLE tuple_size<__tuple_types<_Tp...> >
+class _LIBCPP_TYPE_VIS tuple_size<__tuple_types<_Tp...> >
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
diff --git a/system/include/libcxx/__tuple_03 b/system/include/libcxx/__tuple_03
index a28ac080..605d84df 100644
--- a/system/include/libcxx/__tuple_03
+++ b/system/include/libcxx/__tuple_03
@@ -19,8 +19,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
-template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
+template <class _Tp> class _LIBCPP_TYPE_VIS tuple_size;
+template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS tuple_element;
_LIBCPP_END_NAMESPACE_STD
diff --git a/system/include/libcxx/array b/system/include/libcxx/array
index f4a3020a..bcf53478 100644
--- a/system/include/libcxx/array
+++ b/system/include/libcxx/array
@@ -118,7 +118,7 @@ template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept;
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, size_t _Size>
-struct _LIBCPP_VISIBLE array
+struct _LIBCPP_TYPE_VIS array
{
// types:
typedef array __self;
@@ -284,22 +284,22 @@ swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
}
template <class _Tp, size_t _Size>
-class _LIBCPP_VISIBLE tuple_size<array<_Tp, _Size> >
+class _LIBCPP_TYPE_VIS tuple_size<array<_Tp, _Size> >
: public integral_constant<size_t, _Size> {};
template <class _Tp, size_t _Size>
-class _LIBCPP_VISIBLE tuple_size<const array<_Tp, _Size> >
+class _LIBCPP_TYPE_VIS tuple_size<const array<_Tp, _Size> >
: public integral_constant<size_t, _Size> {};
template <size_t _Ip, class _Tp, size_t _Size>
-class _LIBCPP_VISIBLE tuple_element<_Ip, array<_Tp, _Size> >
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, array<_Tp, _Size> >
{
public:
typedef _Tp type;
};
template <size_t _Ip, class _Tp, size_t _Size>
-class _LIBCPP_VISIBLE tuple_element<_Ip, const array<_Tp, _Size> >
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, const array<_Tp, _Size> >
{
public:
typedef const _Tp type;
diff --git a/system/include/libcxx/bitset b/system/include/libcxx/bitset
index 06fd729e..dd9be4fc 100644
--- a/system/include/libcxx/bitset
+++ b/system/include/libcxx/bitset
@@ -253,7 +253,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
: __first_{__v}
#elif __SIZE_WIDTH__ == 32
: __first_{__v, __v >> __bits_per_word}
-#elif
+#else
#error This constructor has not been ported to this platform
#endif
#endif
@@ -632,11 +632,11 @@ __bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
{
}
-template <size_t _Size> class _LIBCPP_VISIBLE bitset;
-template <size_t _Size> struct hash<bitset<_Size> >;
+template <size_t _Size> class _LIBCPP_TYPE_VIS bitset;
+template <size_t _Size> struct _LIBCPP_TYPE_VIS hash<bitset<_Size> >;
template <size_t _Size>
-class _LIBCPP_VISIBLE bitset
+class _LIBCPP_TYPE_VIS bitset
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
{
public:
@@ -1060,7 +1060,7 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
}
template <size_t _Size>
-struct _LIBCPP_VISIBLE hash<bitset<_Size> >
+struct _LIBCPP_TYPE_VIS hash<bitset<_Size> >
: public unary_function<bitset<_Size>, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/system/include/libcxx/chrono b/system/include/libcxx/chrono
index 508c1f37..3b96e816 100644
--- a/system/include/libcxx/chrono
+++ b/system/include/libcxx/chrono
@@ -279,7 +279,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace chrono
{
-template <class _Rep, class _Period = ratio<1> > class _LIBCPP_VISIBLE duration;
+template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TYPE_VIS duration;
template <class _Tp>
struct __is_duration : false_type {};
@@ -299,7 +299,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
} // chrono
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-struct _LIBCPP_VISIBLE common_type<chrono::duration<_Rep1, _Period1>,
+struct _LIBCPP_TYPE_VIS common_type<chrono::duration<_Rep1, _Period1>,
chrono::duration<_Rep2, _Period2> >
{
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
@@ -377,10 +377,10 @@ duration_cast(const duration<_Rep, _Period>& __fd)
}
template <class _Rep>
-struct _LIBCPP_VISIBLE treat_as_floating_point : is_floating_point<_Rep> {};
+struct _LIBCPP_TYPE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
template <class _Rep>
-struct _LIBCPP_VISIBLE duration_values
+struct _LIBCPP_TYPE_VIS duration_values
{
public:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
@@ -391,7 +391,7 @@ public:
// duration
template <class _Rep, class _Period>
-class _LIBCPP_VISIBLE duration
+class _LIBCPP_TYPE_VIS duration
{
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
@@ -696,7 +696,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
//////////////////////////////////////////////////////////
template <class _Clock, class _Duration = typename _Clock::duration>
-class _LIBCPP_VISIBLE time_point
+class _LIBCPP_TYPE_VIS time_point
{
static_assert(__is_duration<_Duration>::value,
"Second template parameter of time_point must be a std::chrono::duration");
@@ -740,7 +740,7 @@ public:
} // chrono
template <class _Clock, class _Duration1, class _Duration2>
-struct _LIBCPP_VISIBLE common_type<chrono::time_point<_Clock, _Duration1>,
+struct _LIBCPP_TYPE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
chrono::time_point<_Clock, _Duration2> >
{
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
@@ -863,7 +863,7 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
/////////////////////// clocks ///////////////////////////
//////////////////////////////////////////////////////////
-class _LIBCPP_VISIBLE system_clock
+class _LIBCPP_TYPE_VIS system_clock
{
public:
typedef microseconds duration;
@@ -877,7 +877,7 @@ public:
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
-class _LIBCPP_VISIBLE steady_clock
+class _LIBCPP_TYPE_VIS steady_clock
{
public:
typedef nanoseconds duration;
diff --git a/system/include/libcxx/codecvt b/system/include/libcxx/codecvt
index 6c44e343..a6e4308e 100644
--- a/system/include/libcxx/codecvt
+++ b/system/include/libcxx/codecvt
@@ -179,7 +179,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_VISIBLE codecvt_utf8
+class _LIBCPP_TYPE_VIS codecvt_utf8
: public __codecvt_utf8<_Elem>
{
public:
@@ -407,7 +407,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_VISIBLE codecvt_utf16
+class _LIBCPP_TYPE_VIS codecvt_utf16
: public __codecvt_utf16<_Elem, _Mode & little_endian>
{
public:
@@ -530,7 +530,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_VISIBLE codecvt_utf8_utf16
+class _LIBCPP_TYPE_VIS codecvt_utf8_utf16
: public __codecvt_utf8_utf16<_Elem>
{
public:
diff --git a/system/include/libcxx/complex b/system/include/libcxx/complex
index 07d37546..a09bf70f 100644
--- a/system/include/libcxx/complex
+++ b/system/include/libcxx/complex
@@ -255,13 +255,13 @@ template<class T, class charT, class traits>
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp> class _LIBCPP_VISIBLE complex;
+template<class _Tp> class _LIBCPP_TYPE_VIS complex;
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
template<class _Tp>
-class _LIBCPP_VISIBLE complex
+class _LIBCPP_TYPE_VIS complex
{
public:
typedef _Tp value_type;
@@ -319,11 +319,11 @@ public:
}
};
-template<> class _LIBCPP_VISIBLE complex<double>;
-template<> class _LIBCPP_VISIBLE complex<long double>;
+template<> class _LIBCPP_TYPE_VIS complex<double>;
+template<> class _LIBCPP_TYPE_VIS complex<long double>;
template<>
-class _LIBCPP_VISIBLE complex<float>
+class _LIBCPP_TYPE_VIS complex<float>
{
float __re_;
float __im_;
@@ -379,7 +379,7 @@ public:
};
template<>
-class _LIBCPP_VISIBLE complex<double>
+class _LIBCPP_TYPE_VIS complex<double>
{
double __re_;
double __im_;
@@ -435,7 +435,7 @@ public:
};
template<>
-class _LIBCPP_VISIBLE complex<long double>
+class _LIBCPP_TYPE_VIS complex<long double>
{
long double __re_;
long double __im_;
diff --git a/system/include/libcxx/condition_variable b/system/include/libcxx/condition_variable
index b1a50ee5..dc67266a 100644
--- a/system/include/libcxx/condition_variable
+++ b/system/include/libcxx/condition_variable
@@ -117,7 +117,7 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE condition_variable_any
+class _LIBCPP_TYPE_VIS condition_variable_any
{
condition_variable __cv_;
shared_ptr<mutex> __mut_;
@@ -248,7 +248,7 @@ condition_variable_any::wait_for(_Lock& __lock,
_VSTD::move(__pred));
}
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
_LIBCPP_END_NAMESPACE_STD
diff --git a/system/include/libcxx/cstddef b/system/include/libcxx/cstddef
index 24670897..c2637721 100644
--- a/system/include/libcxx/cstddef
+++ b/system/include/libcxx/cstddef
@@ -56,7 +56,7 @@ typedef long double max_align_t;
#ifdef _LIBCPP_HAS_NO_NULLPTR
-struct _LIBCPP_VISIBLE nullptr_t
+struct _LIBCPP_TYPE_VIS nullptr_t
{
void* __lx;
diff --git a/system/include/libcxx/cwchar b/system/include/libcxx/cwchar
index eed6de18..caed08de 100644
--- a/system/include/libcxx/cwchar
+++ b/system/include/libcxx/cwchar
@@ -106,7 +106,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
#include <__config>
#include <cwctype>
#include <wchar.h>
-#if _WIN32
+#ifdef _WIN32
#include <support/win32/support.h> // pull in *swprintf defines
#endif // _WIN32
diff --git a/system/include/libcxx/deque b/system/include/libcxx/deque
index b86d77f9..8e098223 100644
--- a/system/include/libcxx/deque
+++ b/system/include/libcxx/deque
@@ -170,7 +170,7 @@ template <class _Tp, class _Allocator> class __deque_base;
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
class _DiffType, _DiffType _BlockSize>
-class _LIBCPP_VISIBLE __deque_iterator;
+class _LIBCPP_TYPE_VIS __deque_iterator;
template <class _RAIter,
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -262,7 +262,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
class _DiffType, _DiffType _BlockSize>
-class _LIBCPP_VISIBLE __deque_iterator
+class _LIBCPP_TYPE_VIS __deque_iterator
{
typedef _MapPointer __map_iterator;
public:
@@ -410,9 +410,9 @@ private:
: __m_iter_(__m), __ptr_(__p) {}
template <class _Tp, class _Ap> friend class __deque_base;
- template <class _Tp, class _Ap> friend class _LIBCPP_VISIBLE deque;
+ template <class _Tp, class _Ap> friend class _LIBCPP_TYPE_VIS deque;
template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
- friend class _LIBCPP_VISIBLE __deque_iterator;
+ friend class _LIBCPP_TYPE_VIS __deque_iterator;
template <class _RAIter,
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -1167,7 +1167,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
}
template <class _Tp, class _Allocator = allocator<_Tp> >
-class _LIBCPP_VISIBLE deque
+class _LIBCPP_TYPE_VIS deque
: private __deque_base<_Tp, _Allocator>
{
public:
diff --git a/system/include/libcxx/exception b/system/include/libcxx/exception
index 51a48c82..37bfc57e 100644
--- a/system/include/libcxx/exception
+++ b/system/include/libcxx/exception
@@ -105,23 +105,23 @@ public:
};
typedef void (*unexpected_handler)();
-_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
-_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_VISIBLE void unexpected();
+_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
typedef void (*terminate_handler)();
-_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
-_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
+_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
-_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
+_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-class _LIBCPP_VISIBLE exception_ptr;
+class _LIBCPP_TYPE_VIS exception_ptr;
exception_ptr current_exception() _NOEXCEPT;
_LIBCPP_NORETURN void rethrow_exception(exception_ptr);
-class _LIBCPP_VISIBLE exception_ptr
+class _LIBCPP_TYPE_VIS exception_ptr
{
void* __ptr_;
public:
diff --git a/system/include/libcxx/ext/__hash b/system/include/libcxx/ext/__hash
index 21500e89..f6ecfe36 100644
--- a/system/include/libcxx/ext/__hash
+++ b/system/include/libcxx/ext/__hash
@@ -19,10 +19,10 @@
namespace __gnu_cxx {
using namespace std;
-template <typename T> struct _LIBCPP_VISIBLE hash : public std::hash<T>
+template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>
{ };
-template <> struct _LIBCPP_VISIBLE hash<const char*>
+template <> struct _LIBCPP_TYPE_VIS hash<const char*>
: public unary_function<const char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -32,7 +32,7 @@ template <> struct _LIBCPP_VISIBLE hash<const char*>
}
};
-template <> struct _LIBCPP_VISIBLE hash<char *>
+template <> struct _LIBCPP_TYPE_VIS hash<char *>
: public unary_function<char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/system/include/libcxx/ext/hash_map b/system/include/libcxx/ext/hash_map
index bebdccb3..a6fe894e 100644
--- a/system/include/libcxx/ext/hash_map
+++ b/system/include/libcxx/ext/hash_map
@@ -361,7 +361,7 @@ public:
};
template <class _HashIterator>
-class _LIBCPP_VISIBLE __hash_map_iterator
+class _LIBCPP_TYPE_VIS __hash_map_iterator
{
_HashIterator __i_;
@@ -404,15 +404,15 @@ public:
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
};
template <class _HashIterator>
-class _LIBCPP_VISIBLE __hash_map_const_iterator
+class _LIBCPP_TYPE_VIS __hash_map_const_iterator
{
_HashIterator __i_;
@@ -463,15 +463,15 @@ public:
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE hash_map
+class _LIBCPP_TYPE_VIS hash_map
{
public:
// types
@@ -750,7 +750,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE hash_multimap
+class _LIBCPP_TYPE_VIS hash_multimap
{
public:
// types
diff --git a/system/include/libcxx/ext/hash_set b/system/include/libcxx/ext/hash_set
index 14daf7bc..52bbeee1 100644
--- a/system/include/libcxx/ext/hash_set
+++ b/system/include/libcxx/ext/hash_set
@@ -208,7 +208,7 @@ using namespace std;
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_VISIBLE hash_set
+class _LIBCPP_TYPE_VIS hash_set
{
public:
// types
@@ -429,7 +429,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_VISIBLE hash_multiset
+class _LIBCPP_TYPE_VIS hash_multiset
{
public:
// types
diff --git a/system/include/libcxx/forward_list b/system/include/libcxx/forward_list
index 404c6eb1..0cbf2fdb 100644
--- a/system/include/libcxx/forward_list
+++ b/system/include/libcxx/forward_list
@@ -212,11 +212,11 @@ struct __forward_list_node
value_type __value_;
};
-template<class _Tp, class _Alloc> class _LIBCPP_VISIBLE forward_list;
-template<class _NodeConstPtr> class _LIBCPP_VISIBLE __forward_list_const_iterator;
+template<class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS forward_list;
+template<class _NodeConstPtr> class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
template <class _NodePtr>
-class _LIBCPP_VISIBLE __forward_list_iterator
+class _LIBCPP_TYPE_VIS __forward_list_iterator
{
typedef _NodePtr __node_pointer;
@@ -225,8 +225,8 @@ class _LIBCPP_VISIBLE __forward_list_iterator
_LIBCPP_INLINE_VISIBILITY
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
- template<class, class> friend class _LIBCPP_VISIBLE forward_list;
- template<class> friend class _LIBCPP_VISIBLE __forward_list_const_iterator;
+ template<class, class> friend class _LIBCPP_TYPE_VIS forward_list;
+ template<class> friend class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
public:
typedef forward_iterator_tag iterator_category;
@@ -276,7 +276,7 @@ public:
};
template <class _NodeConstPtr>
-class _LIBCPP_VISIBLE __forward_list_const_iterator
+class _LIBCPP_TYPE_VIS __forward_list_const_iterator
{
typedef _NodeConstPtr __node_const_pointer;
@@ -533,7 +533,7 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
}
template <class _Tp, class _Alloc = allocator<_Tp> >
-class _LIBCPP_VISIBLE forward_list
+class _LIBCPP_TYPE_VIS forward_list
: private __forward_list_base<_Tp, _Alloc>
{
typedef __forward_list_base<_Tp, _Alloc> base;
diff --git a/system/include/libcxx/fstream b/system/include/libcxx/fstream
index 1b8e7a0a..0a5cf92a 100644
--- a/system/include/libcxx/fstream
+++ b/system/include/libcxx/fstream
@@ -180,7 +180,7 @@ typedef basic_fstream<wchar_t> wfstream;
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_filebuf
+class _LIBCPP_TYPE_VIS basic_filebuf
: public basic_streambuf<_CharT, _Traits>
{
public:
@@ -978,7 +978,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
// basic_ifstream
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_ifstream
+class _LIBCPP_TYPE_VIS basic_ifstream
: public basic_istream<_CharT, _Traits>
{
public:
@@ -1123,7 +1123,7 @@ basic_ifstream<_CharT, _Traits>::close()
// basic_ofstream
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_ofstream
+class _LIBCPP_TYPE_VIS basic_ofstream
: public basic_ostream<_CharT, _Traits>
{
public:
@@ -1268,7 +1268,7 @@ basic_ofstream<_CharT, _Traits>::close()
// basic_fstream
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_fstream
+class _LIBCPP_TYPE_VIS basic_fstream
: public basic_iostream<_CharT, _Traits>
{
public:
diff --git a/system/include/libcxx/functional b/system/include/libcxx/functional
index 25827822..995db564 100644
--- a/system/include/libcxx/functional
+++ b/system/include/libcxx/functional
@@ -474,63 +474,63 @@ POLICY: For non-variadic implementations, the number of arguments is limited
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct _LIBCPP_VISIBLE plus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS plus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x + __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE minus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS minus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x - __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE multiplies : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS multiplies : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x * __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE divides : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS divides : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x / __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE modulus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS modulus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x % __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE negate : unary_function<_Tp, _Tp>
+struct _LIBCPP_TYPE_VIS negate : unary_function<_Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const
{return -__x;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE equal_to : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS equal_to : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x == __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE not_equal_to : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS not_equal_to : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x != __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE greater : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS greater : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x > __y;}
@@ -539,63 +539,63 @@ struct _LIBCPP_VISIBLE greater : binary_function<_Tp, _Tp, bool>
// less in <__functional_base>
template <class _Tp>
-struct _LIBCPP_VISIBLE greater_equal : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x >= __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE less_equal : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS less_equal : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x <= __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE logical_and : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS logical_and : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x && __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE logical_or : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TYPE_VIS logical_or : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
{return __x || __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE logical_not : unary_function<_Tp, bool>
+struct _LIBCPP_TYPE_VIS logical_not : unary_function<_Tp, bool>
{
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x) const
{return !__x;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE bit_and : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS bit_and : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x & __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE bit_or : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS bit_or : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x | __y;}
};
template <class _Tp>
-struct _LIBCPP_VISIBLE bit_xor : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TYPE_VIS bit_xor : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x ^ __y;}
};
template <class _Predicate>
-class _LIBCPP_VISIBLE unary_negate
+class _LIBCPP_TYPE_VIS unary_negate
: public unary_function<typename _Predicate::argument_type, bool>
{
_Predicate __pred_;
@@ -612,7 +612,7 @@ unary_negate<_Predicate>
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
template <class _Predicate>
-class _LIBCPP_VISIBLE binary_negate
+class _LIBCPP_TYPE_VIS binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type,
bool>
@@ -632,7 +632,7 @@ binary_negate<_Predicate>
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
template <class __Operation>
-class _LIBCPP_VISIBLE binder1st
+class _LIBCPP_TYPE_VIS binder1st
: public unary_function<typename __Operation::second_argument_type,
typename __Operation::result_type>
{
@@ -658,7 +658,7 @@ bind1st(const __Operation& __op, const _Tp& __x)
{return binder1st<__Operation>(__op, __x);}
template <class __Operation>
-class _LIBCPP_VISIBLE binder2nd
+class _LIBCPP_TYPE_VIS binder2nd
: public unary_function<typename __Operation::first_argument_type,
typename __Operation::result_type>
{
@@ -684,7 +684,7 @@ bind2nd(const __Operation& __op, const _Tp& __x)
{return binder2nd<__Operation>(__op, __x);}
template <class _Arg, class _Result>
-class _LIBCPP_VISIBLE pointer_to_unary_function
+class _LIBCPP_TYPE_VIS pointer_to_unary_function
: public unary_function<_Arg, _Result>
{
_Result (*__f_)(_Arg);
@@ -702,7 +702,7 @@ ptr_fun(_Result (*__f)(_Arg))
{return pointer_to_unary_function<_Arg,_Result>(__f);}
template <class _Arg1, class _Arg2, class _Result>
-class _LIBCPP_VISIBLE pointer_to_binary_function
+class _LIBCPP_TYPE_VIS pointer_to_binary_function
: public binary_function<_Arg1, _Arg2, _Result>
{
_Result (*__f_)(_Arg1, _Arg2);
@@ -720,7 +720,7 @@ ptr_fun(_Result (*__f)(_Arg1,_Arg2))
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
template<class _Sp, class _Tp>
-class _LIBCPP_VISIBLE mem_fun_t : public unary_function<_Tp*, _Sp>
+class _LIBCPP_TYPE_VIS mem_fun_t : public unary_function<_Tp*, _Sp>
{
_Sp (_Tp::*__p_)();
public:
@@ -731,7 +731,7 @@ public:
};
template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_VISIBLE mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
+class _LIBCPP_TYPE_VIS mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap);
public:
@@ -754,7 +754,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap))
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
template<class _Sp, class _Tp>
-class _LIBCPP_VISIBLE mem_fun_ref_t : public unary_function<_Tp, _Sp>
+class _LIBCPP_TYPE_VIS mem_fun_ref_t : public unary_function<_Tp, _Sp>
{
_Sp (_Tp::*__p_)();
public:
@@ -765,7 +765,7 @@ public:
};
template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_VISIBLE mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
+class _LIBCPP_TYPE_VIS mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap);
public:
@@ -788,7 +788,7 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
template <class _Sp, class _Tp>
-class _LIBCPP_VISIBLE const_mem_fun_t : public unary_function<const _Tp*, _Sp>
+class _LIBCPP_TYPE_VIS const_mem_fun_t : public unary_function<const _Tp*, _Sp>
{
_Sp (_Tp::*__p_)() const;
public:
@@ -799,7 +799,7 @@ public:
};
template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_VISIBLE const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
+class _LIBCPP_TYPE_VIS const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap) const;
public:
@@ -822,7 +822,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap) const)
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
template <class _Sp, class _Tp>
-class _LIBCPP_VISIBLE const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
+class _LIBCPP_TYPE_VIS const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
{
_Sp (_Tp::*__p_)() const;
public:
@@ -833,7 +833,7 @@ public:
};
template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_VISIBLE const_mem_fun1_ref_t
+class _LIBCPP_TYPE_VIS const_mem_fun1_ref_t
: public binary_function<_Tp, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap) const;
@@ -932,7 +932,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
{
};
-template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
+template<class _Fp> class _LIBCPP_TYPE_VIS function; // undefined
namespace __function
{
@@ -1083,7 +1083,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
} // __function
template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)>
+class _LIBCPP_TYPE_VIS function<_Rp(_ArgTypes...)>
: public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
{
@@ -1496,11 +1496,11 @@ swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCE
{return __x.swap(__y);}
template<class _Tp> struct __is_bind_expression : public false_type {};
-template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
+template<class _Tp> struct _LIBCPP_TYPE_VIS is_bind_expression
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
-template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
+template<class _Tp> struct _LIBCPP_TYPE_VIS is_placeholder
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
namespace placeholders
@@ -1859,7 +1859,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
#endif // _LIBCPP_HAS_NO_VARIADICS
template <>
-struct _LIBCPP_VISIBLE hash<bool>
+struct _LIBCPP_TYPE_VIS hash<bool>
: public unary_function<bool, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1867,7 +1867,7 @@ struct _LIBCPP_VISIBLE hash<bool>
};
template <>
-struct _LIBCPP_VISIBLE hash<char>
+struct _LIBCPP_TYPE_VIS hash<char>
: public unary_function<char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1875,7 +1875,7 @@ struct _LIBCPP_VISIBLE hash<char>
};
template <>
-struct _LIBCPP_VISIBLE hash<signed char>
+struct _LIBCPP_TYPE_VIS hash<signed char>
: public unary_function<signed char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1883,7 +1883,7 @@ struct _LIBCPP_VISIBLE hash<signed char>
};
template <>
-struct _LIBCPP_VISIBLE hash<unsigned char>
+struct _LIBCPP_TYPE_VIS hash<unsigned char>
: public unary_function<unsigned char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1893,7 +1893,7 @@ struct _LIBCPP_VISIBLE hash<unsigned char>
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <>
-struct _LIBCPP_VISIBLE hash<char16_t>
+struct _LIBCPP_TYPE_VIS hash<char16_t>
: public unary_function<char16_t, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1901,7 +1901,7 @@ struct _LIBCPP_VISIBLE hash<char16_t>
};
template <>
-struct _LIBCPP_VISIBLE hash<char32_t>
+struct _LIBCPP_TYPE_VIS hash<char32_t>
: public unary_function<char32_t, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1911,7 +1911,7 @@ struct _LIBCPP_VISIBLE hash<char32_t>
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
template <>
-struct _LIBCPP_VISIBLE hash<wchar_t>
+struct _LIBCPP_TYPE_VIS hash<wchar_t>
: public unary_function<wchar_t, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1919,7 +1919,7 @@ struct _LIBCPP_VISIBLE hash<wchar_t>
};
template <>
-struct _LIBCPP_VISIBLE hash<short>
+struct _LIBCPP_TYPE_VIS hash<short>
: public unary_function<short, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1927,7 +1927,7 @@ struct _LIBCPP_VISIBLE hash<short>
};
template <>
-struct _LIBCPP_VISIBLE hash<unsigned short>
+struct _LIBCPP_TYPE_VIS hash<unsigned short>
: public unary_function<unsigned short, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1935,7 +1935,7 @@ struct _LIBCPP_VISIBLE hash<unsigned short>
};
template <>
-struct _LIBCPP_VISIBLE hash<int>
+struct _LIBCPP_TYPE_VIS hash<int>
: public unary_function<int, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1943,7 +1943,7 @@ struct _LIBCPP_VISIBLE hash<int>
};
template <>
-struct _LIBCPP_VISIBLE hash<unsigned int>
+struct _LIBCPP_TYPE_VIS hash<unsigned int>
: public unary_function<unsigned int, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1951,7 +1951,7 @@ struct _LIBCPP_VISIBLE hash<unsigned int>
};
template <>
-struct _LIBCPP_VISIBLE hash<long>
+struct _LIBCPP_TYPE_VIS hash<long>
: public unary_function<long, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1959,7 +1959,7 @@ struct _LIBCPP_VISIBLE hash<long>
};
template <>
-struct _LIBCPP_VISIBLE hash<unsigned long>
+struct _LIBCPP_TYPE_VIS hash<unsigned long>
: public unary_function<unsigned long, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1967,19 +1967,19 @@ struct _LIBCPP_VISIBLE hash<unsigned long>
};
template <>
-struct _LIBCPP_VISIBLE hash<long long>
+struct _LIBCPP_TYPE_VIS hash<long long>
: public __scalar_hash<long long>
{
};
template <>
-struct _LIBCPP_VISIBLE hash<unsigned long long>
+struct _LIBCPP_TYPE_VIS hash<unsigned long long>
: public __scalar_hash<unsigned long long>
{
};
template <>
-struct _LIBCPP_VISIBLE hash<float>
+struct _LIBCPP_TYPE_VIS hash<float>
: public __scalar_hash<float>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1993,7 +1993,7 @@ struct _LIBCPP_VISIBLE hash<float>
};
template <>
-struct _LIBCPP_VISIBLE hash<double>
+struct _LIBCPP_TYPE_VIS hash<double>
: public __scalar_hash<double>
{
_LIBCPP_INLINE_VISIBILITY
@@ -2007,7 +2007,7 @@ struct _LIBCPP_VISIBLE hash<double>
};
template <>
-struct _LIBCPP_VISIBLE hash<long double>
+struct _LIBCPP_TYPE_VIS hash<long double>
: public __scalar_hash<long double>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/system/include/libcxx/future b/system/include/libcxx/future
index fa605e7d..3d7bb6c9 100644
--- a/system/include/libcxx/future
+++ b/system/include/libcxx/future
@@ -387,11 +387,11 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
template <>
-struct _LIBCPP_VISIBLE is_error_code_enum<future_errc> : public true_type {};
+struct _LIBCPP_TYPE_VIS is_error_code_enum<future_errc> : public true_type {};
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_VISIBLE is_error_code_enum<future_errc::__lx> : public true_type { };
+struct _LIBCPP_TYPE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
#endif
//enum class launch
@@ -412,7 +412,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_status)
};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
const error_category& future_category() _NOEXCEPT;
inline _LIBCPP_INLINE_VISIBILITY
@@ -966,12 +966,12 @@ __async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT
base::__on_zero_shared();
}
-template <class _Rp> class _LIBCPP_VISIBLE promise;
-template <class _Rp> class _LIBCPP_VISIBLE shared_future;
+template <class _Rp> class _LIBCPP_TYPE_VIS promise;
+template <class _Rp> class _LIBCPP_TYPE_VIS shared_future;
// future
-template <class _Rp> class _LIBCPP_VISIBLE future;
+template <class _Rp> class _LIBCPP_TYPE_VIS future;
template <class _Rp, class _Fp>
future<_Rp>
@@ -990,7 +990,7 @@ __make_async_assoc_state(_Fp __f);
#endif
template <class _Rp>
-class _LIBCPP_VISIBLE future
+class _LIBCPP_TYPE_VIS future
{
__assoc_state<_Rp>* __state_;
@@ -1094,7 +1094,7 @@ future<_Rp>::get()
}
template <class _Rp>
-class _LIBCPP_VISIBLE future<_Rp&>
+class _LIBCPP_TYPE_VIS future<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -1193,7 +1193,7 @@ future<_Rp&>::get()
}
template <>
-class _LIBCPP_VISIBLE future<void>
+class _LIBCPP_TYPE_VIS future<void>
{
__assoc_sub_state* __state_;
@@ -1275,7 +1275,7 @@ swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
template <class _Callable> class packaged_task;
template <class _Rp>
-class _LIBCPP_VISIBLE promise
+class _LIBCPP_TYPE_VIS promise
{
__assoc_state<_Rp>* __state_;
@@ -1453,7 +1453,7 @@ promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
// promise<R&>
template <class _Rp>
-class _LIBCPP_VISIBLE promise<_Rp&>
+class _LIBCPP_TYPE_VIS promise<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -1596,7 +1596,7 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
// promise<void>
template <>
-class _LIBCPP_VISIBLE promise<void>
+class _LIBCPP_TYPE_VIS promise<void>
{
__assoc_sub_state* __state_;
@@ -1670,7 +1670,7 @@ swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
}
template <class _Rp, class _Alloc>
- struct _LIBCPP_VISIBLE uses_allocator<promise<_Rp>, _Alloc>
+ struct _LIBCPP_TYPE_VIS uses_allocator<promise<_Rp>, _Alloc>
: public true_type {};
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1934,7 +1934,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) cons
}
template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_VISIBLE packaged_task<_Rp(_ArgTypes...)>
+class _LIBCPP_TYPE_VIS packaged_task<_Rp(_ArgTypes...)>
{
public:
typedef _Rp result_type;
@@ -2049,7 +2049,7 @@ packaged_task<_Rp(_ArgTypes...)>::reset()
}
template<class ..._ArgTypes>
-class _LIBCPP_VISIBLE packaged_task<void(_ArgTypes...)>
+class _LIBCPP_TYPE_VIS packaged_task<void(_ArgTypes...)>
{
public:
typedef void result_type;
@@ -2174,7 +2174,7 @@ swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
}
template <class _Callable, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator<packaged_task<_Callable>, _Alloc>
+struct _LIBCPP_TYPE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
: public true_type {};
template <class _Rp, class _Fp>
@@ -2263,7 +2263,7 @@ async(_Fp&& __f, _Args&&... __args)
// shared_future
template <class _Rp>
-class _LIBCPP_VISIBLE shared_future
+class _LIBCPP_TYPE_VIS shared_future
{
__assoc_state<_Rp>* __state_;
@@ -2337,7 +2337,7 @@ shared_future<_Rp>::operator=(const shared_future& __rhs)
}
template <class _Rp>
-class _LIBCPP_VISIBLE shared_future<_Rp&>
+class _LIBCPP_TYPE_VIS shared_future<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -2411,7 +2411,7 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
}
template <>
-class _LIBCPP_VISIBLE shared_future<void>
+class _LIBCPP_TYPE_VIS shared_future<void>
{
__assoc_sub_state* __state_;
diff --git a/system/include/libcxx/initializer_list b/system/include/libcxx/initializer_list
index 2f88514b..181313d1 100644
--- a/system/include/libcxx/initializer_list
+++ b/system/include/libcxx/initializer_list
@@ -56,7 +56,7 @@ namespace std // purposefully not versioned
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template<class _Ep>
-class _LIBCPP_VISIBLE initializer_list
+class _LIBCPP_TYPE_VIS initializer_list
{
const _Ep* __begin_;
size_t __size_;
diff --git a/system/include/libcxx/ios b/system/include/libcxx/ios
index 1474deb4..25bbfc0b 100644
--- a/system/include/libcxx/ios
+++ b/system/include/libcxx/ios
@@ -224,10 +224,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
typedef ptrdiff_t streamsize;
-class _LIBCPP_VISIBLE ios_base
+class _LIBCPP_TYPE_VIS ios_base
{
public:
- class _LIBCPP_VISIBLE failure;
+ class _LIBCPP_TYPE_VIS failure;
typedef unsigned int fmtflags;
static const fmtflags boolalpha = 0x0001;
@@ -271,7 +271,7 @@ public:
typedef _VSTD::streamoff streamoff;
typedef _VSTD::streampos streampos;
- class _LIBCPP_VISIBLE Init;
+ class _LIBCPP_TYPE_VIS Init;
// 27.5.2.2 fmtflags state:
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
@@ -380,14 +380,14 @@ _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
template <>
-struct _LIBCPP_VISIBLE is_error_code_enum<io_errc> : public true_type { };
+struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc> : public true_type { };
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_VISIBLE is_error_code_enum<io_errc::__lx> : public true_type { };
+struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
#endif
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
const error_category& iostream_category();
inline _LIBCPP_INLINE_VISIBILITY
@@ -413,7 +413,7 @@ public:
virtual ~failure() throw();
};
-class _LIBCPP_VISIBLE ios_base::Init
+class _LIBCPP_TYPE_VIS ios_base::Init
{
public:
Init();
@@ -560,7 +560,7 @@ ios_base::exceptions(iostate __except)
}
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_ios
+class _LIBCPP_TYPE_VIS basic_ios
: public ios_base
{
public:
diff --git a/system/include/libcxx/iosfwd b/system/include/libcxx/iosfwd
index efdff5f3..849d7e51 100644
--- a/system/include/libcxx/iosfwd
+++ b/system/include/libcxx/iosfwd
@@ -95,49 +95,49 @@ typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE ios_base;
+class _LIBCPP_TYPE_VIS ios_base;
-template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
-template<class _Tp> class _LIBCPP_VISIBLE allocator;
+template<class _CharT> struct _LIBCPP_TYPE_VIS char_traits;
+template<class _Tp> class _LIBCPP_TYPE_VIS allocator;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_ios;
+ class _LIBCPP_TYPE_VIS basic_ios;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_streambuf;
+ class _LIBCPP_TYPE_VIS basic_streambuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_istream;
+ class _LIBCPP_TYPE_VIS basic_istream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_ostream;
+ class _LIBCPP_TYPE_VIS basic_ostream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_iostream;
+ class _LIBCPP_TYPE_VIS basic_iostream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_VISIBLE basic_stringbuf;
+ class _LIBCPP_TYPE_VIS basic_stringbuf;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_VISIBLE basic_istringstream;
+ class _LIBCPP_TYPE_VIS basic_istringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_VISIBLE basic_ostringstream;
+ class _LIBCPP_TYPE_VIS basic_ostringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_VISIBLE basic_stringstream;
+ class _LIBCPP_TYPE_VIS basic_stringstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_filebuf;
+ class _LIBCPP_TYPE_VIS basic_filebuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_ifstream;
+ class _LIBCPP_TYPE_VIS basic_ifstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_ofstream;
+ class _LIBCPP_TYPE_VIS basic_ofstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE basic_fstream;
+ class _LIBCPP_TYPE_VIS basic_fstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE istreambuf_iterator;
+ class _LIBCPP_TYPE_VIS istreambuf_iterator;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_VISIBLE ostreambuf_iterator;
+ class _LIBCPP_TYPE_VIS ostreambuf_iterator;
typedef basic_ios<char> ios;
typedef basic_ios<wchar_t> wios;
@@ -172,7 +172,7 @@ typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
-template <class _State> class _LIBCPP_VISIBLE fpos;
+template <class _State> class _LIBCPP_TYPE_VIS fpos;
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
@@ -185,7 +185,7 @@ typedef long long streamoff; // for char_traits in <string>
template <class _CharT, // for <stdexcept>
class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_VISIBLE basic_string;
+ class _LIBCPP_TYPE_VIS basic_string;
typedef basic_string<char, char_traits<char>, allocator<char> > string;
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
diff --git a/system/include/libcxx/iostream b/system/include/libcxx/iostream
index 53cd146c..ddf24841 100644
--- a/system/include/libcxx/iostream
+++ b/system/include/libcxx/iostream
@@ -46,14 +46,14 @@ extern wostream wclog;
_LIBCPP_BEGIN_NAMESPACE_STD
-extern _LIBCPP_VISIBLE istream cin;
-extern _LIBCPP_VISIBLE ostream cout;
-extern _LIBCPP_VISIBLE ostream cerr;
-extern _LIBCPP_VISIBLE ostream clog;
-extern _LIBCPP_VISIBLE wistream wcin;
-extern _LIBCPP_VISIBLE wostream wcout;
-extern _LIBCPP_VISIBLE wostream wcerr;
-extern _LIBCPP_VISIBLE wostream wclog;
+extern _LIBCPP_FUNC_VIS istream cin;
+extern _LIBCPP_FUNC_VIS ostream cout;
+extern _LIBCPP_FUNC_VIS ostream cerr;
+extern _LIBCPP_FUNC_VIS ostream clog;
+extern _LIBCPP_FUNC_VIS wistream wcin;
+extern _LIBCPP_FUNC_VIS wostream wcout;
+extern _LIBCPP_FUNC_VIS wostream wcerr;
+extern _LIBCPP_FUNC_VIS wostream wclog;
_LIBCPP_END_NAMESPACE_STD
diff --git a/system/include/libcxx/istream b/system/include/libcxx/istream
index 3979e140..3f629f68 100644
--- a/system/include/libcxx/istream
+++ b/system/include/libcxx/istream
@@ -164,7 +164,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_istream
+class _LIBCPP_TYPE_VIS basic_istream
: virtual public basic_ios<_CharT, _Traits>
{
streamsize __gc_;
@@ -194,7 +194,7 @@ protected:
public:
// 27.7.1.1.3 Prefix/suffix:
- class _LIBCPP_VISIBLE sentry;
+ class _LIBCPP_TYPE_VIS sentry;
// 27.7.1.2 Formatted input:
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
@@ -244,7 +244,7 @@ public:
};
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_istream<_CharT, _Traits>::sentry
+class _LIBCPP_TYPE_VIS basic_istream<_CharT, _Traits>::sentry
{
bool __ok_;
@@ -1216,16 +1216,9 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
sentry __sen(*this, true);
if (__sen)
{
- for (; __gc_ < __n; ++__gc_)
- {
- typename traits_type::int_type __i = this->rdbuf()->sbumpc();
- if (traits_type::eq_int_type(__i, traits_type::eof()))
- {
- this->setstate(ios_base::failbit | ios_base::eofbit);
- break;
- }
- *__s++ = traits_type::to_char_type(__i);
- }
+ __gc_ = this->rdbuf()->sgetn(__s, __n);
+ if (__gc_ != __n)
+ this->setstate(ios_base::failbit | ios_base::eofbit);
}
else
this->setstate(ios_base::failbit);
@@ -1460,7 +1453,7 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_iostream
+class _LIBCPP_TYPE_VIS basic_iostream
: public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
diff --git a/system/include/libcxx/iterator b/system/include/libcxx/iterator
index b23310b0..3b078a2a 100644
--- a/system/include/libcxx/iterator
+++ b/system/include/libcxx/iterator
@@ -317,7 +317,7 @@ template <class T, size_t N> T* end(T (&array)[N]);
#include <type_traits>
#include <cstddef>
#include <iosfwd>
-#if __APPLE__
+#ifdef __APPLE__
#include <Availability.h>
#endif
@@ -331,11 +331,11 @@ template <class T, size_t N> T* end(T (&array)[N]);
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_VISIBLE input_iterator_tag {};
-struct _LIBCPP_VISIBLE output_iterator_tag {};
-struct _LIBCPP_VISIBLE forward_iterator_tag : public input_iterator_tag {};
-struct _LIBCPP_VISIBLE bidirectional_iterator_tag : public forward_iterator_tag {};
-struct _LIBCPP_VISIBLE random_access_iterator_tag : public bidirectional_iterator_tag {};
+struct _LIBCPP_TYPE_VIS input_iterator_tag {};
+struct _LIBCPP_TYPE_VIS output_iterator_tag {};
+struct _LIBCPP_TYPE_VIS forward_iterator_tag : public input_iterator_tag {};
+struct _LIBCPP_TYPE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
+struct _LIBCPP_TYPE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
template <class _Tp>
struct __has_iterator_category
@@ -378,11 +378,11 @@ struct __iterator_traits<_Iter, true>
// the client expects instead of failing at compile time.
template <class _Iter>
-struct _LIBCPP_VISIBLE iterator_traits
+struct _LIBCPP_TYPE_VIS iterator_traits
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
template<class _Tp>
-struct _LIBCPP_VISIBLE iterator_traits<_Tp*>
+struct _LIBCPP_TYPE_VIS iterator_traits<_Tp*>
{
typedef ptrdiff_t difference_type;
typedef typename remove_const<_Tp>::type value_type;
@@ -413,7 +413,7 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&>
-struct _LIBCPP_VISIBLE iterator
+struct _LIBCPP_TYPE_VIS iterator
{
typedef _Tp value_type;
typedef _Distance difference_type;
@@ -510,7 +510,7 @@ prev(_BidiretionalIter __x,
}
template <class _Iter>
-class _LIBCPP_VISIBLE reverse_iterator
+class _LIBCPP_TYPE_VIS reverse_iterator
: public iterator<typename iterator_traits<_Iter>::iterator_category,
typename iterator_traits<_Iter>::value_type,
typename iterator_traits<_Iter>::difference_type,
@@ -617,7 +617,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
}
template <class _Container>
-class _LIBCPP_VISIBLE back_insert_iterator
+class _LIBCPP_TYPE_VIS back_insert_iterator
: public iterator<output_iterator_tag,
void,
void,
@@ -650,7 +650,7 @@ back_inserter(_Container& __x)
}
template <class _Container>
-class _LIBCPP_VISIBLE front_insert_iterator
+class _LIBCPP_TYPE_VIS front_insert_iterator
: public iterator<output_iterator_tag,
void,
void,
@@ -683,7 +683,7 @@ front_inserter(_Container& __x)
}
template <class _Container>
-class _LIBCPP_VISIBLE insert_iterator
+class _LIBCPP_TYPE_VIS insert_iterator
: public iterator<output_iterator_tag,
void,
void,
@@ -719,7 +719,7 @@ inserter(_Container& __x, typename _Container::iterator __i)
template <class _Tp, class _CharT = char,
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
-class _LIBCPP_VISIBLE istream_iterator
+class _LIBCPP_TYPE_VIS istream_iterator
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
{
public:
@@ -758,7 +758,7 @@ public:
};
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
-class _LIBCPP_VISIBLE ostream_iterator
+class _LIBCPP_TYPE_VIS ostream_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
@@ -787,7 +787,7 @@ public:
};
template<class _CharT, class _Traits>
-class _LIBCPP_VISIBLE istreambuf_iterator
+class _LIBCPP_TYPE_VIS istreambuf_iterator
: public iterator<input_iterator_tag, _CharT,
typename _Traits::off_type, _CharT*,
_CharT>
@@ -858,7 +858,7 @@ bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
{return !__a.equal(__b);}
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE ostreambuf_iterator
+class _LIBCPP_TYPE_VIS ostreambuf_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
@@ -899,7 +899,7 @@ public:
};
template <class _Iter>
-class _LIBCPP_VISIBLE move_iterator
+class _LIBCPP_TYPE_VIS move_iterator
{
private:
_Iter __i;
diff --git a/system/include/libcxx/limits b/system/include/libcxx/limits
index f089a794..9b9d7a6f 100644
--- a/system/include/libcxx/limits
+++ b/system/include/libcxx/limits
@@ -433,7 +433,7 @@ protected:
};
template <class _Tp>
-class _LIBCPP_VISIBLE numeric_limits
+class _LIBCPP_TYPE_VIS numeric_limits
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
{
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
@@ -526,7 +526,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;
template <class _Tp>
-class _LIBCPP_VISIBLE numeric_limits<const _Tp>
+class _LIBCPP_TYPE_VIS numeric_limits<const _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
@@ -619,7 +619,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;
template <class _Tp>
-class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
+class _LIBCPP_TYPE_VIS numeric_limits<volatile _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
@@ -712,7 +712,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;
template <class _Tp>
-class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
+class _LIBCPP_TYPE_VIS numeric_limits<const volatile _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
diff --git a/system/include/libcxx/list b/system/include/libcxx/list
index 81258869..06904d96 100644
--- a/system/include/libcxx/list
+++ b/system/include/libcxx/list
@@ -213,12 +213,12 @@ struct __list_node
_Tp __value_;
};
-template <class _Tp, class _Alloc> class _LIBCPP_VISIBLE list;
+template <class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS list;
template <class _Tp, class _Alloc> class __list_imp;
-template <class _Tp, class _VoidPtr> class _LIBCPP_VISIBLE __list_const_iterator;
+template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS __list_const_iterator;
template <class _Tp, class _VoidPtr>
-class _LIBCPP_VISIBLE __list_iterator
+class _LIBCPP_TYPE_VIS __list_iterator
{
typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -348,7 +348,7 @@ public:
};
template <class _Tp, class _VoidPtr>
-class _LIBCPP_VISIBLE __list_const_iterator
+class _LIBCPP_TYPE_VIS __list_const_iterator
{
typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -767,7 +767,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
}
template <class _Tp, class _Alloc = allocator<_Tp> >
-class _LIBCPP_VISIBLE list
+class _LIBCPP_TYPE_VIS list
: private __list_imp<_Tp, _Alloc>
{
typedef __list_imp<_Tp, _Alloc> base;
diff --git a/system/include/libcxx/locale b/system/include/libcxx/locale
index 83259214..05020e17 100644
--- a/system/include/libcxx/locale
+++ b/system/include/libcxx/locale
@@ -181,18 +181,18 @@ template <class charT> class messages_byname;
#include <streambuf>
#include <iterator>
#include <limits>
-#if !__APPLE__
+#ifndef __APPLE__
#include <cstdarg>
#endif
#include <cstdlib>
#include <ctime>
-#if _WIN32
+#ifdef _WIN32
#include <support/win32/locale_win32.h>
#else // _WIN32
#include <nl_types.h>
#endif // !_WIN32
-#if __APPLE__
+#ifdef __APPLE__
#include <Availability.h>
#endif
@@ -204,7 +204,7 @@ template <class charT> class messages_byname;
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __APPLE__ || __FreeBSD__
+#if defined(__APPLE__) || defined(__FreeBSD__)
# define _LIBCPP_GET_C_LOCALE 0
#else
# define _LIBCPP_GET_C_LOCALE __cloc()
@@ -646,6 +646,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
_CharT __decimal_point, _CharT __thousands_sep, const string& __grouping,
unsigned* __g, unsigned*& __g_end, unsigned& __dc, _CharT* __atoms)
{
+ if (__a_end-__a >= __num_get_buf_sz - 1)
+ return -1;
if (__ct == __decimal_point)
{
if (!__in_units)
@@ -673,23 +675,27 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
char __x = __src[__f];
if (__x == '-' || __x == '+')
{
- if (__a_end == __a || (__a_end[-1] & 0xDF) == __exp)
+ if (__a_end == __a || (__a_end[-1] & 0x5F) == (__exp & 0x7F))
{
*__a_end++ = __x;
return 0;
}
return -1;
}
- if (__a_end-__a < __num_get_buf_sz - 1)
- *__a_end++ = __x;
if (__x == 'x' || __x == 'X')
__exp = 'P';
- else if ((__x & 0xDF) == __exp)
+ else if ((__x & 0x5F) == __exp)
{
- __in_units = false;
- if (__grouping.size() != 0 && __g_end-__g < __num_get_buf_sz)
- *__g_end++ = __dc;
+ __exp |= 0x80;
+ if (__in_units)
+ {
+ __in_units = false;
+ if (__grouping.size() != 0 && __g_end-__g < __num_get_buf_sz)
+ *__g_end++ = __dc;
+ }
}
+ if (__a_end-__a < __num_get_buf_sz - ((__exp & 0x80) ? 1 : 11))
+ *__a_end++ = __x;
if (__f >= 22)
return 0;
++__dc;
@@ -700,7 +706,7 @@ _LIBCPP_EXTERN_TEMPLATE(struct __num_get<char>)
_LIBCPP_EXTERN_TEMPLATE(struct __num_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE num_get
+class _LIBCPP_TYPE_VIS num_get
: public locale::facet,
private __num_get<_CharT>
{
@@ -1472,7 +1478,7 @@ _LIBCPP_EXTERN_TEMPLATE(struct __num_put<char>)
_LIBCPP_EXTERN_TEMPLATE(struct __num_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE num_put
+class _LIBCPP_TYPE_VIS num_put
: public locale::facet,
private __num_put<_CharT>
{
@@ -1984,7 +1990,7 @@ __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
return __r;
}
-class _LIBCPP_VISIBLE time_base
+class _LIBCPP_TYPE_VIS time_base
{
public:
enum dateorder {no_order, dmy, mdy, ymd, ydm};
@@ -2006,7 +2012,7 @@ protected:
};
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE time_get
+class _LIBCPP_TYPE_VIS time_get
: public locale::facet,
public time_base,
private __time_get_c_storage<_CharT>
@@ -2656,7 +2662,7 @@ private:
};
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE time_get_byname
+class _LIBCPP_TYPE_VIS time_get_byname
: public time_get<_CharT, _InputIterator>,
private __time_get_storage<_CharT>
{
@@ -2716,7 +2722,7 @@ protected:
};
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE time_put
+class _LIBCPP_TYPE_VIS time_put
: public locale::facet,
private __time_put
{
@@ -2815,7 +2821,7 @@ _LIBCPP_EXTERN_TEMPLATE(class time_put<char>)
_LIBCPP_EXTERN_TEMPLATE(class time_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE time_put_byname
+class _LIBCPP_TYPE_VIS time_put_byname
: public time_put<_CharT, _OutputIterator>
{
public:
@@ -2837,7 +2843,7 @@ _LIBCPP_EXTERN_TEMPLATE(class time_put_byname<wchar_t>)
// money_base
-class _LIBCPP_VISIBLE money_base
+class _LIBCPP_TYPE_VIS money_base
{
public:
enum part {none, space, symbol, sign, value};
@@ -2849,7 +2855,7 @@ public:
// moneypunct
template <class _CharT, bool _International = false>
-class _LIBCPP_VISIBLE moneypunct
+class _LIBCPP_TYPE_VIS moneypunct
: public locale::facet,
public money_base
{
@@ -2907,7 +2913,7 @@ _LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, true>)
// moneypunct_byname
template <class _CharT, bool _International = false>
-class _LIBCPP_VISIBLE moneypunct_byname
+class _LIBCPP_TYPE_VIS moneypunct_byname
: public moneypunct<_CharT, _International>
{
public:
@@ -3019,7 +3025,7 @@ _LIBCPP_EXTERN_TEMPLATE(class __money_get<char>)
_LIBCPP_EXTERN_TEMPLATE(class __money_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE money_get
+class _LIBCPP_TYPE_VIS money_get
: public locale::facet,
private __money_get<_CharT>
{
@@ -3353,7 +3359,7 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
if (__neg)
*__nc++ = '-';
for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
- *__nc = __src[find(__atoms, __atoms+sizeof(__atoms), *__w) - __atoms];
+ *__nc = __src[find(__atoms, _VSTD::end(__atoms), *__w) - __atoms];
*__nc = char();
if (sscanf(__nbuf, "%Lf", &__v) != 1)
__throw_runtime_error("money_get error");
@@ -3575,7 +3581,7 @@ _LIBCPP_EXTERN_TEMPLATE(class __money_put<char>)
_LIBCPP_EXTERN_TEMPLATE(class __money_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_VISIBLE money_put
+class _LIBCPP_TYPE_VIS money_put
: public locale::facet,
private __money_put<_CharT>
{
@@ -3733,7 +3739,7 @@ _LIBCPP_EXTERN_TEMPLATE(class money_put<wchar_t>)
// messages
-class _LIBCPP_VISIBLE messages_base
+class _LIBCPP_TYPE_VIS messages_base
{
public:
typedef ptrdiff_t catalog;
@@ -3742,7 +3748,7 @@ public:
};
template <class _CharT>
-class _LIBCPP_VISIBLE messages
+class _LIBCPP_TYPE_VIS messages
: public locale::facet,
public messages_base
{
@@ -3793,7 +3799,7 @@ template <class _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
{
-#if _WIN32
+#ifdef _WIN32
return -1;
#else // _WIN32
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
@@ -3808,7 +3814,7 @@ typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
const string_type& __dflt) const
{
-#if _WIN32
+#ifdef _WIN32
return __dflt;
#else // _WIN32
string __ndflt;
@@ -3830,7 +3836,7 @@ template <class _CharT>
void
messages<_CharT>::do_close(catalog __c) const
{
-#if !_WIN32
+#if !defined(_WIN32)
if (__c != -1)
__c <<= 1;
nl_catd __cat = (nl_catd)__c;
@@ -3842,7 +3848,7 @@ _LIBCPP_EXTERN_TEMPLATE(class messages<char>)
_LIBCPP_EXTERN_TEMPLATE(class messages<wchar_t>)
template <class _CharT>
-class _LIBCPP_VISIBLE messages_byname
+class _LIBCPP_TYPE_VIS messages_byname
: public messages<_CharT>
{
public:
@@ -3868,7 +3874,7 @@ _LIBCPP_EXTERN_TEMPLATE(class messages_byname<wchar_t>)
template<class _Codecvt, class _Elem = wchar_t,
class _Wide_alloc = allocator<_Elem>,
class _Byte_alloc = allocator<char> >
-class _LIBCPP_VISIBLE wstring_convert
+class _LIBCPP_TYPE_VIS wstring_convert
{
public:
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
@@ -4121,7 +4127,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
}
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
-class _LIBCPP_VISIBLE wbuffer_convert
+class _LIBCPP_TYPE_VIS wbuffer_convert
: public basic_streambuf<_Elem, _Tr>
{
public:
diff --git a/system/include/libcxx/map b/system/include/libcxx/map
index dd98da5e..abc07a35 100644
--- a/system/include/libcxx/map
+++ b/system/include/libcxx/map
@@ -537,7 +537,7 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class _TreeIterator> class __map_const_iterator;
template <class _TreeIterator>
-class _LIBCPP_VISIBLE __map_iterator
+class _LIBCPP_TYPE_VIS __map_iterator
{
_TreeIterator __i_;
@@ -596,13 +596,13 @@ public:
bool operator!=(const __map_iterator& __x, const __map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
- template <class> friend class _LIBCPP_VISIBLE __map_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __map_const_iterator;
};
template <class _TreeIterator>
-class _LIBCPP_VISIBLE __map_const_iterator
+class _LIBCPP_TYPE_VIS __map_const_iterator
{
_TreeIterator __i_;
@@ -665,14 +665,14 @@ public:
bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
- template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
- template <class, class, class> friend class _LIBCPP_VISIBLE __tree_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TYPE_VIS __tree_const_iterator;
};
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE map
+class _LIBCPP_TYPE_VIS map
{
public:
// types:
@@ -684,7 +684,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
- class _LIBCPP_VISIBLE value_compare
+ class _LIBCPP_TYPE_VIS value_compare
: public binary_function<value_type, value_type, bool>
{
friend class map;
@@ -1422,7 +1422,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE multimap
+class _LIBCPP_TYPE_VIS multimap
{
public:
// types:
@@ -1434,7 +1434,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
- class _LIBCPP_VISIBLE value_compare
+ class _LIBCPP_TYPE_VIS value_compare
: public binary_function<value_type, value_type, bool>
{
friend class multimap;
diff --git a/system/include/libcxx/memory b/system/include/libcxx/memory
index 4e1f7046..fe352382 100644
--- a/system/include/libcxx/memory
+++ b/system/include/libcxx/memory
@@ -667,7 +667,7 @@ addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
template <class _Tp> class allocator;
template <>
-class _LIBCPP_VISIBLE allocator<void>
+class _LIBCPP_TYPE_VIS allocator<void>
{
public:
typedef void* pointer;
@@ -678,7 +678,7 @@ public:
};
template <>
-class _LIBCPP_VISIBLE allocator<const void>
+class _LIBCPP_TYPE_VIS allocator<const void>
{
public:
typedef const void* pointer;
@@ -913,7 +913,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
#endif // _LIBCPP_HAS_NO_VARIADICS
template <class _Ptr>
-struct _LIBCPP_VISIBLE pointer_traits
+struct _LIBCPP_TYPE_VIS pointer_traits
{
typedef _Ptr pointer;
typedef typename __pointer_traits_element_type<pointer>::type element_type;
@@ -936,7 +936,7 @@ public:
};
template <class _Tp>
-struct _LIBCPP_VISIBLE pointer_traits<_Tp*>
+struct _LIBCPP_TYPE_VIS pointer_traits<_Tp*>
{
typedef _Tp* pointer;
typedef _Tp element_type;
@@ -1443,7 +1443,7 @@ struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
};
template <class _Alloc>
-struct _LIBCPP_VISIBLE allocator_traits
+struct _LIBCPP_TYPE_VIS allocator_traits
{
typedef _Alloc allocator_type;
typedef typename allocator_type::value_type value_type;
@@ -1649,7 +1649,7 @@ private:
// allocator
template <class _Tp>
-class _LIBCPP_VISIBLE allocator
+class _LIBCPP_TYPE_VIS allocator
{
public:
typedef size_t size_type;
@@ -1741,7 +1741,7 @@ public:
};
template <class _Tp>
-class _LIBCPP_VISIBLE allocator<const _Tp>
+class _LIBCPP_TYPE_VIS allocator<const _Tp>
{
public:
typedef size_t size_type;
@@ -1839,7 +1839,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
template <class _OutputIterator, class _Tp>
-class _LIBCPP_VISIBLE raw_storage_iterator
+class _LIBCPP_TYPE_VIS raw_storage_iterator
: public iterator<output_iterator_tag,
_Tp, // purposefully not C++03
ptrdiff_t, // purposefully not C++03
@@ -1892,7 +1892,7 @@ struct auto_ptr_ref
};
template<class _Tp>
-class _LIBCPP_VISIBLE auto_ptr
+class _LIBCPP_TYPE_VIS auto_ptr
{
private:
_Tp* __ptr_;
@@ -1936,7 +1936,7 @@ public:
};
template <>
-class _LIBCPP_VISIBLE auto_ptr<void>
+class _LIBCPP_TYPE_VIS auto_ptr<void>
{
public:
typedef void element_type;
@@ -2472,7 +2472,7 @@ struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
// default_delete
template <class _Tp>
-struct _LIBCPP_VISIBLE default_delete
+struct _LIBCPP_TYPE_VIS default_delete
{
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
@@ -2490,7 +2490,7 @@ struct _LIBCPP_VISIBLE default_delete
};
template <class _Tp>
-struct _LIBCPP_VISIBLE default_delete<_Tp[]>
+struct _LIBCPP_TYPE_VIS default_delete<_Tp[]>
{
public:
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
@@ -2512,7 +2512,7 @@ public:
};
template <class _Tp, class _Dp = default_delete<_Tp> >
-class _LIBCPP_VISIBLE unique_ptr
+class _LIBCPP_TYPE_VIS unique_ptr
{
public:
typedef _Tp element_type;
@@ -2691,7 +2691,7 @@ public:
};
template <class _Tp, class _Dp>
-class _LIBCPP_VISIBLE unique_ptr<_Tp[], _Dp>
+class _LIBCPP_TYPE_VIS unique_ptr<_Tp[], _Dp>
{
public:
typedef _Tp element_type;
@@ -3393,7 +3393,7 @@ struct __scalar_hash<_Tp, 4>
};
template<class _Tp>
-struct _LIBCPP_VISIBLE hash<_Tp*>
+struct _LIBCPP_TYPE_VIS hash<_Tp*>
: public unary_function<_Tp*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -3410,7 +3410,7 @@ struct _LIBCPP_VISIBLE hash<_Tp*>
};
template <class _Tp, class _Dp>
-struct _LIBCPP_VISIBLE hash<unique_ptr<_Tp, _Dp> >
+struct _LIBCPP_TYPE_VIS hash<unique_ptr<_Tp, _Dp> >
{
typedef unique_ptr<_Tp, _Dp> argument_type;
typedef size_t result_type;
@@ -3583,7 +3583,7 @@ public:
virtual const char* what() const _NOEXCEPT;
};
-template<class _Tp> class _LIBCPP_VISIBLE weak_ptr;
+template<class _Tp> class _LIBCPP_TYPE_VIS weak_ptr;
class __shared_count
{
@@ -3752,10 +3752,10 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
__a.deallocate(this, 1);
}
-template<class _Tp> class _LIBCPP_VISIBLE enable_shared_from_this;
+template<class _Tp> class _LIBCPP_TYPE_VIS enable_shared_from_this;
template<class _Tp>
-class _LIBCPP_VISIBLE shared_ptr
+class _LIBCPP_TYPE_VIS shared_ptr
{
public:
typedef _Tp element_type;
@@ -4024,8 +4024,8 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __enable_weak_this(const void*) _NOEXCEPT {}
- template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
- template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
+ template <class _Up> friend class _LIBCPP_TYPE_VIS shared_ptr;
+ template <class _Up> friend class _LIBCPP_TYPE_VIS weak_ptr;
};
template<class _Tp>
@@ -4921,7 +4921,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
#endif // _LIBCPP_NO_RTTI
template<class _Tp>
-class _LIBCPP_VISIBLE weak_ptr
+class _LIBCPP_TYPE_VIS weak_ptr
{
public:
typedef _Tp element_type;
@@ -4996,8 +4996,8 @@ public:
bool owner_before(const weak_ptr<_Up>& __r) const
{return __cntrl_ < __r.__cntrl_;}
- template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
- template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
+ template <class _Up> friend class _LIBCPP_TYPE_VIS weak_ptr;
+ template <class _Up> friend class _LIBCPP_TYPE_VIS shared_ptr;
};
template<class _Tp>
@@ -5197,7 +5197,7 @@ weak_ptr<_Tp>::lock() const _NOEXCEPT
template <class _Tp> struct owner_less;
template <class _Tp>
-struct _LIBCPP_VISIBLE owner_less<shared_ptr<_Tp> >
+struct _LIBCPP_TYPE_VIS owner_less<shared_ptr<_Tp> >
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
{
typedef bool result_type;
@@ -5213,7 +5213,7 @@ struct _LIBCPP_VISIBLE owner_less<shared_ptr<_Tp> >
};
template <class _Tp>
-struct _LIBCPP_VISIBLE owner_less<weak_ptr<_Tp> >
+struct _LIBCPP_TYPE_VIS owner_less<weak_ptr<_Tp> >
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
{
typedef bool result_type;
@@ -5229,7 +5229,7 @@ struct _LIBCPP_VISIBLE owner_less<weak_ptr<_Tp> >
};
template<class _Tp>
-class _LIBCPP_VISIBLE enable_shared_from_this
+class _LIBCPP_TYPE_VIS enable_shared_from_this
{
mutable weak_ptr<_Tp> __weak_this_;
protected:
@@ -5254,7 +5254,7 @@ public:
};
template <class _Tp>
-struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> >
+struct _LIBCPP_TYPE_VIS hash<shared_ptr<_Tp> >
{
typedef shared_ptr<_Tp> argument_type;
typedef size_t result_type;
@@ -5284,10 +5284,10 @@ private:
__sp_mut(const __sp_mut&);
__sp_mut& operator=(const __sp_mut&);
- friend _LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
+ friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
};
-_LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
+_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5399,7 +5399,7 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
#endif // __has_feature(cxx_atomic)
//enum class
-struct _LIBCPP_VISIBLE pointer_safety
+struct _LIBCPP_TYPE_VIS pointer_safety
{
enum __lx
{
diff --git a/system/include/libcxx/mutex b/system/include/libcxx/mutex
index ee20f021..e2b5d6bf 100644
--- a/system/include/libcxx/mutex
+++ b/system/include/libcxx/mutex
@@ -187,7 +187,7 @@ template<class Callable, class ...Args>
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE recursive_mutex
+class _LIBCPP_TYPE_VIS recursive_mutex
{
pthread_mutex_t __m_;
@@ -209,7 +209,7 @@ public:
native_handle_type native_handle() {return &__m_;}
};
-class _LIBCPP_VISIBLE timed_mutex
+class _LIBCPP_TYPE_VIS timed_mutex
{
mutex __m_;
condition_variable __cv_;
@@ -251,7 +251,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
return false;
}
-class _LIBCPP_VISIBLE recursive_timed_mutex
+class _LIBCPP_TYPE_VIS recursive_timed_mutex
{
mutex __m_;
condition_variable __cv_;
@@ -425,7 +425,7 @@ lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
#endif // _LIBCPP_HAS_NO_VARIADICS
-struct _LIBCPP_VISIBLE once_flag;
+struct _LIBCPP_TYPE_VIS once_flag;
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -441,7 +441,7 @@ void call_once(once_flag&, _Callable);
#endif // _LIBCPP_HAS_NO_VARIADICS
-struct _LIBCPP_VISIBLE once_flag
+struct _LIBCPP_TYPE_VIS once_flag
{
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
diff --git a/system/include/libcxx/new b/system/include/libcxx/new
index ae0951a7..1e85798b 100644
--- a/system/include/libcxx/new
+++ b/system/include/libcxx/new
@@ -83,31 +83,31 @@ public:
void __throw_bad_alloc(); // not in C++ spec
-struct _LIBCPP_VISIBLE nothrow_t {};
-extern _LIBCPP_VISIBLE const nothrow_t nothrow;
+struct _LIBCPP_TYPE_VIS nothrow_t {};
+extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
typedef void (*new_handler)();
-_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) _NOEXCEPT;
-_LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT;
+_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
} // std
-_LIBCPP_VISIBLE void* operator new(std::size_t __sz)
+_LIBCPP_FUNC_VIS void* operator new(std::size_t __sz)
#if !__has_feature(cxx_noexcept)
throw(std::bad_alloc)
#endif
;
-_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
-_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
+_LIBCPP_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
-_LIBCPP_VISIBLE void* operator new[](std::size_t __sz)
+_LIBCPP_FUNC_VIS void* operator new[](std::size_t __sz)
#if !__has_feature(cxx_noexcept)
throw(std::bad_alloc)
#endif
;
-_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
-_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
+_LIBCPP_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
diff --git a/system/include/libcxx/ostream b/system/include/libcxx/ostream
index b3b6df57..eac9c8f0 100644
--- a/system/include/libcxx/ostream
+++ b/system/include/libcxx/ostream
@@ -140,7 +140,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_ostream
+class _LIBCPP_TYPE_VIS basic_ostream
: virtual public basic_ios<_CharT, _Traits>
{
public:
@@ -169,7 +169,7 @@ protected:
public:
// 27.7.2.4 Prefix/suffix:
- class _LIBCPP_VISIBLE sentry;
+ class _LIBCPP_TYPE_VIS sentry;
// 27.7.2.6 Formatted output:
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
@@ -207,7 +207,7 @@ protected:
};
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_ostream<_CharT, _Traits>::sentry
+class _LIBCPP_TYPE_VIS basic_ostream<_CharT, _Traits>::sentry
{
bool __ok_;
basic_ostream<_CharT, _Traits>& __os_;
diff --git a/system/include/libcxx/queue b/system/include/libcxx/queue
index 4741f003..8d1a9dfc 100644
--- a/system/include/libcxx/queue
+++ b/system/include/libcxx/queue
@@ -177,7 +177,7 @@ template <class T, class Container, class Compare>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container> class _LIBCPP_VISIBLE queue;
+template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS queue;
template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
@@ -190,7 +190,7 @@ bool
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
template <class _Tp, class _Container = deque<_Tp> >
-class _LIBCPP_VISIBLE queue
+class _LIBCPP_TYPE_VIS queue
{
public:
typedef _Container container_type;
@@ -376,14 +376,14 @@ swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
}
template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator<queue<_Tp, _Container>, _Alloc>
+struct _LIBCPP_TYPE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
template <class _Tp, class _Container = vector<_Tp>,
class _Compare = less<typename _Container::value_type> >
-class _LIBCPP_VISIBLE priority_queue
+class _LIBCPP_TYPE_VIS priority_queue
{
public:
typedef _Container container_type;
@@ -707,7 +707,7 @@ swap(priority_queue<_Tp, _Container, _Compare>& __x,
}
template <class _Tp, class _Container, class _Compare, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
+struct _LIBCPP_TYPE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
diff --git a/system/include/libcxx/random b/system/include/libcxx/random
index 04d942bc..92722ea6 100644
--- a/system/include/libcxx/random
+++ b/system/include/libcxx/random
@@ -1813,7 +1813,7 @@ struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
};
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_VISIBLE linear_congruential_engine;
+class _LIBCPP_TYPE_VIS linear_congruential_engine;
template <class _CharT, class _Traits,
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
@@ -1829,7 +1829,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_VISIBLE linear_congruential_engine
+class _LIBCPP_TYPE_VIS linear_congruential_engine
{
public:
// types
@@ -2038,7 +2038,7 @@ typedef minstd_rand default_random_engine;
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_VISIBLE mersenne_twister_engine;
+class _LIBCPP_TYPE_VIS mersenne_twister_engine;
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
@@ -2080,7 +2080,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_VISIBLE mersenne_twister_engine
+class _LIBCPP_TYPE_VIS mersenne_twister_engine
{
public:
// types
@@ -2526,7 +2526,7 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
// subtract_with_carry_engine
template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_VISIBLE subtract_with_carry_engine;
+class _LIBCPP_TYPE_VIS subtract_with_carry_engine;
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
bool
@@ -2554,7 +2554,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_VISIBLE subtract_with_carry_engine
+class _LIBCPP_TYPE_VIS subtract_with_carry_engine
{
public:
// types
@@ -2837,7 +2837,7 @@ typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> ranlux48_base;
// discard_block_engine
template<class _Engine, size_t __p, size_t __r>
-class _LIBCPP_VISIBLE discard_block_engine
+class _LIBCPP_TYPE_VIS discard_block_engine
{
_Engine __e_;
int __n_;
@@ -3010,7 +3010,7 @@ typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
// independent_bits_engine
template<class _Engine, size_t __w, class _UIntType>
-class _LIBCPP_VISIBLE independent_bits_engine
+class _LIBCPP_TYPE_VIS independent_bits_engine
{
template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
class __get_n
@@ -3273,7 +3273,7 @@ public:
};
template<class _Engine, size_t __k>
-class _LIBCPP_VISIBLE shuffle_order_engine
+class _LIBCPP_TYPE_VIS shuffle_order_engine
{
static_assert(0 < __k, "shuffle_order_engine invalid parameters");
public:
@@ -3500,7 +3500,7 @@ typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
// random_device
-class _LIBCPP_VISIBLE random_device
+class _LIBCPP_TYPE_VIS random_device
{
int __f_;
public:
@@ -3534,7 +3534,7 @@ private:
// seed_seq
-class _LIBCPP_VISIBLE seed_seq
+class _LIBCPP_TYPE_VIS seed_seq
{
public:
// types
@@ -3711,13 +3711,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// uniform_real_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE uniform_real_distribution
+class _LIBCPP_TYPE_VIS uniform_real_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -3832,13 +3832,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// bernoulli_distribution
-class _LIBCPP_VISIBLE bernoulli_distribution
+class _LIBCPP_TYPE_VIS bernoulli_distribution
{
public:
// types
typedef bool result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
double __p_;
public:
@@ -3941,13 +3941,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
// binomial_distribution
template<class _IntType = int>
-class _LIBCPP_VISIBLE binomial_distribution
+class _LIBCPP_TYPE_VIS binomial_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __t_;
double __p_;
@@ -4106,13 +4106,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// exponential_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE exponential_distribution
+class _LIBCPP_TYPE_VIS exponential_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __lambda_;
public:
@@ -4221,13 +4221,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// normal_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE normal_distribution
+class _LIBCPP_TYPE_VIS normal_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __mean_;
result_type __stddev_;
@@ -4389,13 +4389,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// lognormal_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE lognormal_distribution
+class _LIBCPP_TYPE_VIS lognormal_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
normal_distribution<result_type> __nd_;
public:
@@ -4514,13 +4514,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// poisson_distribution
template<class _IntType = int>
-class _LIBCPP_VISIBLE poisson_distribution
+class _LIBCPP_TYPE_VIS poisson_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
double __mean_;
double __s_;
@@ -4745,13 +4745,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// weibull_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE weibull_distribution
+class _LIBCPP_TYPE_VIS weibull_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -4859,13 +4859,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
}
template<class _RealType = double>
-class _LIBCPP_VISIBLE extreme_value_distribution
+class _LIBCPP_TYPE_VIS extreme_value_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -4980,13 +4980,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// gamma_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE gamma_distribution
+class _LIBCPP_TYPE_VIS gamma_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __alpha_;
result_type __beta_;
@@ -5152,13 +5152,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// negative_binomial_distribution
template<class _IntType = int>
-class _LIBCPP_VISIBLE negative_binomial_distribution
+class _LIBCPP_TYPE_VIS negative_binomial_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __k_;
double __p_;
@@ -5287,13 +5287,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// geometric_distribution
template<class _IntType = int>
-class _LIBCPP_VISIBLE geometric_distribution
+class _LIBCPP_TYPE_VIS geometric_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
double __p_;
public:
@@ -5389,13 +5389,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// chi_squared_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE chi_squared_distribution
+class _LIBCPP_TYPE_VIS chi_squared_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __n_;
public:
@@ -5495,13 +5495,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// cauchy_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE cauchy_distribution
+class _LIBCPP_TYPE_VIS cauchy_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -5618,13 +5618,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// fisher_f_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE fisher_f_distribution
+class _LIBCPP_TYPE_VIS fisher_f_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __m_;
result_type __n_;
@@ -5740,13 +5740,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// student_t_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE student_t_distribution
+class _LIBCPP_TYPE_VIS student_t_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
result_type __n_;
public:
@@ -5853,13 +5853,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// discrete_distribution
template<class _IntType = int>
-class _LIBCPP_VISIBLE discrete_distribution
+class _LIBCPP_TYPE_VIS discrete_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
vector<double> __p_;
public:
@@ -6084,13 +6084,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// piecewise_constant_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE piecewise_constant_distribution
+class _LIBCPP_TYPE_VIS piecewise_constant_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
vector<result_type> __b_;
vector<result_type> __densities_;
@@ -6408,13 +6408,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// piecewise_linear_distribution
template<class _RealType = double>
-class _LIBCPP_VISIBLE piecewise_linear_distribution
+class _LIBCPP_TYPE_VIS piecewise_linear_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_VISIBLE param_type
+ class _LIBCPP_TYPE_VIS param_type
{
vector<result_type> __b_;
vector<result_type> __densities_;
diff --git a/system/include/libcxx/ratio b/system/include/libcxx/ratio
index 23f22679..f4e741e8 100644
--- a/system/include/libcxx/ratio
+++ b/system/include/libcxx/ratio
@@ -231,7 +231,7 @@ public:
};
template <intmax_t _Num, intmax_t _Den = 1>
-class _LIBCPP_VISIBLE ratio
+class _LIBCPP_TYPE_VIS ratio
{
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
static_assert(_Den != 0, "ratio divide by 0");
@@ -292,7 +292,7 @@ template <class _R1, class _R2> using ratio_multiply
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_multiply
+struct _LIBCPP_TYPE_VIS ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -319,7 +319,7 @@ template <class _R1, class _R2> using ratio_divide
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_divide
+struct _LIBCPP_TYPE_VIS ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -354,7 +354,7 @@ template <class _R1, class _R2> using ratio_add
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_add
+struct _LIBCPP_TYPE_VIS ratio_add
: public __ratio_add<_R1, _R2>::type {};
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -389,7 +389,7 @@ template <class _R1, class _R2> using ratio_subtract
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_subtract
+struct _LIBCPP_TYPE_VIS ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@@ -397,11 +397,11 @@ struct _LIBCPP_VISIBLE ratio_subtract
// ratio_equal
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_equal
+struct _LIBCPP_TYPE_VIS ratio_equal
: public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_not_equal
+struct _LIBCPP_TYPE_VIS ratio_not_equal
: public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};
// ratio_less
@@ -460,19 +460,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
};
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_less
+struct _LIBCPP_TYPE_VIS ratio_less
: public integral_constant<bool, __ratio_less<_R1, _R2>::value> {};
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_less_equal
+struct _LIBCPP_TYPE_VIS ratio_less_equal
: public integral_constant<bool, !ratio_less<_R2, _R1>::value> {};
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_greater
+struct _LIBCPP_TYPE_VIS ratio_greater
: public integral_constant<bool, ratio_less<_R2, _R1>::value> {};
template <class _R1, class _R2>
-struct _LIBCPP_VISIBLE ratio_greater_equal
+struct _LIBCPP_TYPE_VIS ratio_greater_equal
: public integral_constant<bool, !ratio_less<_R1, _R2>::value> {};
template <class _R1, class _R2>
diff --git a/system/include/libcxx/readme.txt b/system/include/libcxx/readme.txt
index c0c90c3a..97d8db86 100644
--- a/system/include/libcxx/readme.txt
+++ b/system/include/libcxx/readme.txt
@@ -1 +1 @@
-These files are from libc++, svn revision 176559, Mar 7 2013
+These files are from libc++, svn revision 178253, Mar 29 2013
diff --git a/system/include/libcxx/regex b/system/include/libcxx/regex
index 982500f3..d1afa54a 100644
--- a/system/include/libcxx/regex
+++ b/system/include/libcxx/regex
@@ -764,7 +764,7 @@ _LIBCPP_CONSTEXPR
syntax_option_type
operator~(syntax_option_type __x)
{
- return syntax_option_type(~int(__x));
+ return syntax_option_type(~int(__x) & 0x1FF);
}
inline _LIBCPP_INLINE_VISIBILITY
@@ -840,7 +840,7 @@ _LIBCPP_CONSTEXPR
match_flag_type
operator~(match_flag_type __x)
{
- return match_flag_type(~int(__x));
+ return match_flag_type(~int(__x) & 0x0FFF);
}
inline _LIBCPP_INLINE_VISIBILITY
@@ -925,7 +925,7 @@ public:
};
template <class _CharT>
-struct _LIBCPP_VISIBLE regex_traits
+struct _LIBCPP_TYPE_VIS regex_traits
{
public:
typedef _CharT char_type;
@@ -1009,6 +1009,10 @@ private:
};
template <class _CharT>
+const typename regex_traits<_CharT>::char_class_type
+regex_traits<_CharT>::__regex_word;
+
+template <class _CharT>
regex_traits<_CharT>::regex_traits()
{
__init();
@@ -1231,11 +1235,11 @@ regex_traits<_CharT>::__value(wchar_t __ch, int __radix) const
template <class _CharT> class __node;
-template <class _BidirectionalIterator> class _LIBCPP_VISIBLE sub_match;
+template <class _BidirectionalIterator> class _LIBCPP_TYPE_VIS sub_match;
template <class _BidirectionalIterator,
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
-class _LIBCPP_VISIBLE match_results;
+class _LIBCPP_TYPE_VIS match_results;
template <class _CharT>
struct __state
@@ -2411,7 +2415,7 @@ __exit:
template <class _CharT, class _Traits> class __lookahead;
template <class _CharT, class _Traits = regex_traits<_CharT> >
-class _LIBCPP_VISIBLE basic_regex
+class _LIBCPP_TYPE_VIS basic_regex
{
public:
// types:
@@ -4749,7 +4753,7 @@ typedef basic_regex<wchar_t> wregex;
// sub_match
template <class _BidirectionalIterator>
-class _LIBCPP_VISIBLE sub_match
+class _LIBCPP_TYPE_VIS sub_match
: public pair<_BidirectionalIterator, _BidirectionalIterator>
{
public:
@@ -5172,7 +5176,7 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
}
template <class _BidirectionalIterator, class _Allocator>
-class _LIBCPP_VISIBLE match_results
+class _LIBCPP_TYPE_VIS match_results
{
public:
typedef _Allocator allocator_type;
@@ -5958,7 +5962,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_VISIBLE regex_iterator
+class _LIBCPP_TYPE_VIS regex_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
@@ -6070,7 +6074,7 @@ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_VISIBLE regex_token_iterator
+class _LIBCPP_TYPE_VIS regex_token_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
diff --git a/system/include/libcxx/scoped_allocator b/system/include/libcxx/scoped_allocator
index cd051020..92532342 100644
--- a/system/include/libcxx/scoped_allocator
+++ b/system/include/libcxx/scoped_allocator
@@ -365,7 +365,7 @@ struct __outermost<_Alloc, true>
};
template <class _OuterAlloc, class... _InnerAllocs>
-class _LIBCPP_VISIBLE scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
+class _LIBCPP_TYPE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
{
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
diff --git a/system/include/libcxx/set b/system/include/libcxx/set
index 36d3dd49..11ea9658 100644
--- a/system/include/libcxx/set
+++ b/system/include/libcxx/set
@@ -346,7 +346,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_VISIBLE set
+class _LIBCPP_TYPE_VIS set
{
public:
// types:
@@ -685,7 +685,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_VISIBLE multiset
+class _LIBCPP_TYPE_VIS multiset
{
public:
// types:
diff --git a/system/include/libcxx/sstream b/system/include/libcxx/sstream
index 22450f0a..c431fec0 100644
--- a/system/include/libcxx/sstream
+++ b/system/include/libcxx/sstream
@@ -186,7 +186,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// basic_stringbuf
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_VISIBLE basic_stringbuf
+class _LIBCPP_TYPE_VIS basic_stringbuf
: public basic_streambuf<_CharT, _Traits>
{
public:
@@ -529,7 +529,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
// basic_istringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_VISIBLE basic_istringstream
+class _LIBCPP_TYPE_VIS basic_istringstream
: public basic_istream<_CharT, _Traits>
{
public:
@@ -648,7 +648,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_ostringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_VISIBLE basic_ostringstream
+class _LIBCPP_TYPE_VIS basic_ostringstream
: public basic_ostream<_CharT, _Traits>
{
public:
@@ -767,7 +767,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_stringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_VISIBLE basic_stringstream
+class _LIBCPP_TYPE_VIS basic_stringstream
: public basic_iostream<_CharT, _Traits>
{
public:
diff --git a/system/include/libcxx/stack b/system/include/libcxx/stack
index 12fb35b7..b8a7f4c0 100644
--- a/system/include/libcxx/stack
+++ b/system/include/libcxx/stack
@@ -91,7 +91,7 @@ template <class T, class Container>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container> class _LIBCPP_VISIBLE stack;
+template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS stack;
template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
@@ -104,7 +104,7 @@ bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
template <class _Tp, class _Container = deque<_Tp> >
-class _LIBCPP_VISIBLE stack
+class _LIBCPP_TYPE_VIS stack
{
public:
typedef _Container container_type;
@@ -282,7 +282,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
}
template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator<stack<_Tp, _Container>, _Alloc>
+struct _LIBCPP_TYPE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
diff --git a/system/include/libcxx/streambuf b/system/include/libcxx/streambuf
index d6880241..82615942 100644
--- a/system/include/libcxx/streambuf
+++ b/system/include/libcxx/streambuf
@@ -119,7 +119,7 @@ protected:
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_VISIBLE basic_streambuf
+class _LIBCPP_TYPE_VIS basic_streambuf
{
public:
// types:
diff --git a/system/include/libcxx/string b/system/include/libcxx/string
index 1a704679..de668bba 100644
--- a/system/include/libcxx/string
+++ b/system/include/libcxx/string
@@ -457,7 +457,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// fpos
template <class _StateT>
-class _LIBCPP_VISIBLE fpos
+class _LIBCPP_TYPE_VIS fpos
{
private:
_StateT __st_;
@@ -494,7 +494,7 @@ bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
// char_traits
template <class _CharT>
-struct _LIBCPP_VISIBLE char_traits
+struct _LIBCPP_TYPE_VIS char_traits
{
typedef _CharT char_type;
typedef int int_type;
@@ -620,7 +620,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
// char_traits<char>
template <>
-struct _LIBCPP_VISIBLE char_traits<char>
+struct _LIBCPP_TYPE_VIS char_traits<char>
{
typedef char char_type;
typedef int int_type;
@@ -676,7 +676,7 @@ struct _LIBCPP_VISIBLE char_traits<char>
// char_traits<wchar_t>
template <>
-struct _LIBCPP_VISIBLE char_traits<wchar_t>
+struct _LIBCPP_TYPE_VIS char_traits<wchar_t>
{
typedef wchar_t char_type;
typedef wint_t int_type;
@@ -733,7 +733,7 @@ struct _LIBCPP_VISIBLE char_traits<wchar_t>
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <>
-struct _LIBCPP_VISIBLE char_traits<char16_t>
+struct _LIBCPP_TYPE_VIS char_traits<char16_t>
{
typedef char16_t char_type;
typedef uint_least16_t int_type;
@@ -853,7 +853,7 @@ char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
}
template <>
-struct _LIBCPP_VISIBLE char_traits<char32_t>
+struct _LIBCPP_TYPE_VIS char_traits<char32_t>
{
typedef char32_t char_type;
typedef uint_least32_t int_type;
@@ -1037,7 +1037,7 @@ _LIBCPP_EXTERN_TEMPLATE(class __basic_string_common<true>)
#endif // _MSC_VER
template<class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_VISIBLE basic_string
+class _LIBCPP_TYPE_VIS basic_string
: private __basic_string_common<true>
{
public:
@@ -3923,7 +3923,7 @@ size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
}
template<class _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_VISIBLE hash<basic_string<_CharT, _Traits, _Allocator> >
+struct _LIBCPP_TYPE_VIS hash<basic_string<_CharT, _Traits, _Allocator> >
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
{
size_t
diff --git a/system/include/libcxx/strstream b/system/include/libcxx/strstream
index 5eadefd1..81eef2ab 100644
--- a/system/include/libcxx/strstream
+++ b/system/include/libcxx/strstream
@@ -137,7 +137,7 @@ private:
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE strstreambuf
+class _LIBCPP_TYPE_VIS strstreambuf
: public streambuf
{
public:
@@ -228,7 +228,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-class _LIBCPP_VISIBLE istrstream
+class _LIBCPP_TYPE_VIS istrstream
: public istream
{
public:
@@ -281,7 +281,7 @@ private:
strstreambuf __sb_;
};
-class _LIBCPP_VISIBLE ostrstream
+class _LIBCPP_TYPE_VIS ostrstream
: public ostream
{
public:
@@ -334,7 +334,7 @@ private:
strstreambuf __sb_; // exposition only
};
-class _LIBCPP_VISIBLE strstream
+class _LIBCPP_TYPE_VIS strstream
: public iostream
{
public:
diff --git a/system/include/libcxx/system_error b/system/include/libcxx/system_error
index cbc52fb7..1c1c7ebd 100644
--- a/system/include/libcxx/system_error
+++ b/system/include/libcxx/system_error
@@ -232,13 +232,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// is_error_code_enum
template <class _Tp>
-struct _LIBCPP_VISIBLE is_error_code_enum
+struct _LIBCPP_TYPE_VIS is_error_code_enum
: public false_type {};
// is_error_condition_enum
template <class _Tp>
-struct _LIBCPP_VISIBLE is_error_condition_enum
+struct _LIBCPP_TYPE_VIS is_error_condition_enum
: public false_type {};
// Some error codes are not present on all platforms, so we provide equivalents
@@ -345,23 +345,23 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
template <>
-struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
+struct _LIBCPP_TYPE_VIS is_error_condition_enum<errc>
: true_type { };
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_VISIBLE is_error_condition_enum<errc::__lx>
+struct _LIBCPP_TYPE_VIS is_error_condition_enum<errc::__lx>
: true_type { };
#endif
-class _LIBCPP_VISIBLE error_condition;
-class _LIBCPP_VISIBLE error_code;
+class _LIBCPP_TYPE_VIS error_condition;
+class _LIBCPP_TYPE_VIS error_code;
// class error_category
class _LIBCPP_HIDDEN __do_message;
-class _LIBCPP_VISIBLE error_category
+class _LIBCPP_TYPE_VIS error_category
{
public:
virtual ~error_category() _NOEXCEPT;
@@ -400,7 +400,7 @@ public:
const error_category& generic_category() _NOEXCEPT;
const error_category& system_category() _NOEXCEPT;
-class _LIBCPP_VISIBLE error_condition
+class _LIBCPP_TYPE_VIS error_condition
{
int __val_;
const error_category* __cat_;
@@ -472,7 +472,7 @@ operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
// error_code
-class _LIBCPP_VISIBLE error_code
+class _LIBCPP_TYPE_VIS error_code
{
int __val_;
const error_category* __cat_;
@@ -597,7 +597,7 @@ operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
{return !(__x == __y);}
template <>
-struct _LIBCPP_VISIBLE hash<error_code>
+struct _LIBCPP_TYPE_VIS hash<error_code>
: public unary_function<error_code, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -609,7 +609,7 @@ struct _LIBCPP_VISIBLE hash<error_code>
// system_error
-class _LIBCPP_VISIBLE system_error
+class _LIBCPP_TYPE_VIS system_error
: public runtime_error
{
error_code __ec_;
diff --git a/system/include/libcxx/thread b/system/include/libcxx/thread
index 60d88859..8d3aab2a 100644
--- a/system/include/libcxx/thread
+++ b/system/include/libcxx/thread
@@ -144,9 +144,11 @@ template <class _Tp>
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
{
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
+#ifndef _LIBCPP_NO_EXCEPTIONS
if (__ec)
throw system_error(error_code(__ec, system_category()),
"__thread_specific_ptr construction failed");
+#endif
}
template <class _Tp>
@@ -173,8 +175,8 @@ __thread_specific_ptr<_Tp>::reset(pointer __p)
delete __p_old;
}
-class _LIBCPP_VISIBLE thread;
-class _LIBCPP_VISIBLE __thread_id;
+class _LIBCPP_TYPE_VIS thread;
+class _LIBCPP_TYPE_VIS __thread_id;
namespace this_thread
{
@@ -183,10 +185,10 @@ _LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
} // this_thread
-class _LIBCPP_VISIBLE __thread_id;
-template<> struct _LIBCPP_VISIBLE hash<__thread_id>;
+class _LIBCPP_TYPE_VIS __thread_id;
+template<> struct _LIBCPP_TYPE_VIS hash<__thread_id>;
-class _LIBCPP_VISIBLE __thread_id
+class _LIBCPP_TYPE_VIS __thread_id
{
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
// NULL is the no-thread value on Darwin. Someone needs to check
@@ -228,12 +230,12 @@ private:
__thread_id(pthread_t __id) : __id_(__id) {}
friend __thread_id this_thread::get_id() _NOEXCEPT;
- friend class _LIBCPP_VISIBLE thread;
- friend struct _LIBCPP_VISIBLE hash<__thread_id>;
+ friend class _LIBCPP_TYPE_VIS thread;
+ friend struct _LIBCPP_TYPE_VIS hash<__thread_id>;
};
template<>
-struct _LIBCPP_VISIBLE hash<__thread_id>
+struct _LIBCPP_TYPE_VIS hash<__thread_id>
: public unary_function<__thread_id, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -255,7 +257,7 @@ get_id() _NOEXCEPT
} // this_thread
-class _LIBCPP_VISIBLE thread
+class _LIBCPP_TYPE_VIS thread
{
pthread_t __t_;
diff --git a/system/include/libcxx/tuple b/system/include/libcxx/tuple
index 3fa6730c..7f299e9d 100644
--- a/system/include/libcxx/tuple
+++ b/system/include/libcxx/tuple
@@ -128,7 +128,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// allocator_arg_t
-struct _LIBCPP_VISIBLE allocator_arg_t { };
+struct _LIBCPP_TYPE_VIS allocator_arg_t { };
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
extern const allocator_arg_t allocator_arg;
@@ -163,7 +163,7 @@ struct __uses_allocator<_Tp, _Alloc, false>
};
template <class _Tp, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator
+struct _LIBCPP_TYPE_VIS uses_allocator
: public __uses_allocator<_Tp, _Alloc>
{
};
@@ -193,7 +193,7 @@ struct __uses_alloc_ctor
// tuple_size
template <class ..._Tp>
-class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
+class _LIBCPP_TYPE_VIS tuple_size<tuple<_Tp...> >
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
@@ -201,7 +201,7 @@ class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
// tuple_element
template <size_t _Ip, class ..._Tp>
-class _LIBCPP_VISIBLE tuple_element<_Ip, tuple<_Tp...> >
+class _LIBCPP_TYPE_VIS tuple_element<_Ip, tuple<_Tp...> >
{
public:
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
@@ -533,7 +533,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
};
template <class ..._Tp>
-class _LIBCPP_VISIBLE tuple
+class _LIBCPP_TYPE_VIS tuple
{
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
@@ -721,7 +721,7 @@ public:
};
template <>
-class _LIBCPP_VISIBLE tuple<>
+class _LIBCPP_TYPE_VIS tuple<>
{
public:
_LIBCPP_INLINE_VISIBILITY
@@ -803,7 +803,7 @@ struct __ignore_t
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
-template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
+template <class _Tp> class _LIBCPP_TYPE_VIS reference_wrapper;
template <class _Tp>
struct ___make_tuple_return
@@ -1071,7 +1071,7 @@ tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
}
template <class ..._Tp, class _Alloc>
-struct _LIBCPP_VISIBLE uses_allocator<tuple<_Tp...>, _Alloc>
+struct _LIBCPP_TYPE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
template <class _T1, class _T2>
diff --git a/system/include/libcxx/type_traits b/system/include/libcxx/type_traits
index 8f1c6024..f60f71b5 100644
--- a/system/include/libcxx/type_traits
+++ b/system/include/libcxx/type_traits
@@ -149,19 +149,19 @@ namespace std
_LIBCPP_BEGIN_NAMESPACE_STD
template <bool _Bp, class _If, class _Then>
- struct _LIBCPP_VISIBLE conditional {typedef _If type;};
+ struct _LIBCPP_TYPE_VIS conditional {typedef _If type;};
template <class _If, class _Then>
- struct _LIBCPP_VISIBLE conditional<false, _If, _Then> {typedef _Then type;};
+ struct _LIBCPP_TYPE_VIS conditional<false, _If, _Then> {typedef _Then type;};
-template <bool, class _Tp = void> struct _LIBCPP_VISIBLE enable_if {};
-template <class _Tp> struct _LIBCPP_VISIBLE enable_if<true, _Tp> {typedef _Tp type;};
+template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS enable_if {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS enable_if<true, _Tp> {typedef _Tp type;};
struct __two {char __lx[2];};
// helper class:
template <class _Tp, _Tp __v>
-struct _LIBCPP_VISIBLE integral_constant
+struct _LIBCPP_TYPE_VIS integral_constant
{
static _LIBCPP_CONSTEXPR const _Tp value = __v;
typedef _Tp value_type;
@@ -178,27 +178,27 @@ typedef integral_constant<bool, false> false_type;
// is_const
-template <class _Tp> struct _LIBCPP_VISIBLE is_const : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_const<_Tp const> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_const : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_const<_Tp const> : public true_type {};
// is_volatile
-template <class _Tp> struct _LIBCPP_VISIBLE is_volatile : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_volatile<_Tp volatile> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_volatile : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_volatile<_Tp volatile> : public true_type {};
// remove_const
-template <class _Tp> struct _LIBCPP_VISIBLE remove_const {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_const<const _Tp> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_const {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_const<const _Tp> {typedef _Tp type;};
// remove_volatile
-template <class _Tp> struct _LIBCPP_VISIBLE remove_volatile {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_volatile<volatile _Tp> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
// remove_cv
-template <class _Tp> struct _LIBCPP_VISIBLE remove_cv
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_cv
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
// is_void
@@ -206,7 +206,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE remove_cv
template <class _Tp> struct __is_void : public false_type {};
template <> struct __is_void<void> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_void
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_void
: public __is_void<typename remove_cv<_Tp>::type> {};
// __is_nullptr_t
@@ -214,7 +214,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_void
template <class _Tp> struct ____is_nullptr_t : public false_type {};
template <> struct ____is_nullptr_t<nullptr_t> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE __is_nullptr_t
+template <class _Tp> struct _LIBCPP_TYPE_VIS __is_nullptr_t
: public ____is_nullptr_t<typename remove_cv<_Tp>::type> {};
// is_integral
@@ -238,7 +238,7 @@ template <> struct __is_integral<unsigned long> : public true_type
template <> struct __is_integral<long long> : public true_type {};
template <> struct __is_integral<unsigned long long> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_integral
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_integral
: public __is_integral<typename remove_cv<_Tp>::type> {};
// is_floating_point
@@ -248,16 +248,16 @@ template <> struct __is_floating_point<float> : public true_type
template <> struct __is_floating_point<double> : public true_type {};
template <> struct __is_floating_point<long double> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_floating_point
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_floating_point
: public __is_floating_point<typename remove_cv<_Tp>::type> {};
// is_array
-template <class _Tp> struct _LIBCPP_VISIBLE is_array
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_array
: public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_array<_Tp[]>
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_array<_Tp[]>
: public true_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE is_array<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS is_array<_Tp[_Np]>
: public true_type {};
// is_pointer
@@ -265,23 +265,23 @@ template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE is_array<_Tp[_Np]>
template <class _Tp> struct __is_pointer : public false_type {};
template <class _Tp> struct __is_pointer<_Tp*> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_pointer
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_pointer
: public __is_pointer<typename remove_cv<_Tp>::type> {};
// is_reference
-template <class _Tp> struct _LIBCPP_VISIBLE is_lvalue_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_lvalue_reference<_Tp&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_lvalue_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_lvalue_reference<_Tp&> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_rvalue_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_rvalue_reference : public false_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_VISIBLE is_rvalue_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
#endif
-template <class _Tp> struct _LIBCPP_VISIBLE is_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_reference<_Tp&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_reference<_Tp&> : public true_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_VISIBLE is_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_reference<_Tp&&> : public true_type {};
#endif
#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
@@ -292,13 +292,13 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_reference<_Tp&&> : public true_ty
#if __has_feature(is_union) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE is_union
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_union
: public integral_constant<bool, __is_union(_Tp)> {};
#else
template <class _Tp> struct __libcpp_union : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_union
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_union
: public __libcpp_union<typename remove_cv<_Tp>::type> {};
#endif
@@ -307,7 +307,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_union
#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE is_class
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_class
: public integral_constant<bool, __is_class(_Tp)> {};
#else
@@ -318,15 +318,15 @@ template <class _Tp> char __test(int _Tp::*);
template <class _Tp> __two __test(...);
}
-template <class _Tp> struct _LIBCPP_VISIBLE is_class
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_class
: public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {};
#endif
// is_same
-template <class _Tp, class _Up> struct _LIBCPP_VISIBLE is_same : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_same<_Tp, _Tp> : public true_type {};
+template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS is_same : public false_type {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_same<_Tp, _Tp> : public true_type {};
// is_function
@@ -347,7 +347,7 @@ struct __is_function
{};
template <class _Tp> struct __is_function<_Tp, true> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_function
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_function
: public __is_function<_Tp> {};
// is_member_function_pointer
@@ -355,7 +355,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_function
template <class _Tp> struct __is_member_function_pointer : public false_type {};
template <class _Tp, class _Up> struct __is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_member_function_pointer
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_member_function_pointer
: public __is_member_function_pointer<typename remove_cv<_Tp>::type> {};
// is_member_pointer
@@ -363,12 +363,12 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_member_function_pointer
template <class _Tp> struct __is_member_pointer : public false_type {};
template <class _Tp, class _Up> struct __is_member_pointer<_Tp _Up::*> : public true_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_member_pointer
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_member_pointer
: public __is_member_pointer<typename remove_cv<_Tp>::type> {};
// is_member_object_pointer
-template <class _Tp> struct _LIBCPP_VISIBLE is_member_object_pointer
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_member_object_pointer
: public integral_constant<bool, is_member_pointer<_Tp>::value &&
!is_member_function_pointer<_Tp>::value> {};
@@ -376,12 +376,12 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_member_object_pointer
#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE is_enum
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_enum
: public integral_constant<bool, __is_enum(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_VISIBLE is_enum
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_enum
: public integral_constant<bool, !is_void<_Tp>::value &&
!is_integral<_Tp>::value &&
!is_floating_point<_Tp>::value &&
@@ -397,31 +397,31 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_enum
// is_arithmetic
-template <class _Tp> struct _LIBCPP_VISIBLE is_arithmetic
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_arithmetic
: public integral_constant<bool, is_integral<_Tp>::value ||
is_floating_point<_Tp>::value> {};
// is_fundamental
-template <class _Tp> struct _LIBCPP_VISIBLE is_fundamental
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_fundamental
: public integral_constant<bool, is_void<_Tp>::value ||
__is_nullptr_t<_Tp>::value ||
is_arithmetic<_Tp>::value> {};
// is_scalar
-template <class _Tp> struct _LIBCPP_VISIBLE is_scalar
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_scalar
: public integral_constant<bool, is_arithmetic<_Tp>::value ||
is_member_pointer<_Tp>::value ||
is_pointer<_Tp>::value ||
__is_nullptr_t<_Tp>::value ||
is_enum<_Tp>::value > {};
-template <> struct _LIBCPP_VISIBLE is_scalar<nullptr_t> : public true_type {};
+template <> struct _LIBCPP_TYPE_VIS is_scalar<nullptr_t> : public true_type {};
// is_object
-template <class _Tp> struct _LIBCPP_VISIBLE is_object
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_object
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_array<_Tp>::value ||
is_union<_Tp>::value ||
@@ -429,7 +429,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_object
// is_compound
-template <class _Tp> struct _LIBCPP_VISIBLE is_compound
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> {};
// add_const
@@ -442,7 +442,7 @@ struct __add_const {typedef _Tp type;};
template <class _Tp>
struct __add_const<_Tp, false> {typedef const _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE add_const
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_const
{typedef typename __add_const<_Tp>::type type;};
// add_volatile
@@ -455,38 +455,38 @@ struct __add_volatile {typedef _Tp type;};
template <class _Tp>
struct __add_volatile<_Tp, false> {typedef volatile _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE add_volatile
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_volatile
{typedef typename __add_volatile<_Tp>::type type;};
// add_cv
-template <class _Tp> struct _LIBCPP_VISIBLE add_cv
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_cv
{typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};
// remove_reference
-template <class _Tp> struct _LIBCPP_VISIBLE remove_reference {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_reference<_Tp&> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference<_Tp&> {typedef _Tp type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_VISIBLE remove_reference<_Tp&&> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference<_Tp&&> {typedef _Tp type;};
#endif
// add_lvalue_reference
-template <class _Tp> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef _Tp& type;};
-template <class _Tp> struct _LIBCPP_VISIBLE add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler
-template <> struct _LIBCPP_VISIBLE add_lvalue_reference<void> {typedef void type;};
-template <> struct _LIBCPP_VISIBLE add_lvalue_reference<const void> {typedef const void type;};
-template <> struct _LIBCPP_VISIBLE add_lvalue_reference<volatile void> {typedef volatile void type;};
-template <> struct _LIBCPP_VISIBLE add_lvalue_reference<const volatile void> {typedef const volatile void type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_lvalue_reference {typedef _Tp& type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler
+template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<void> {typedef void type;};
+template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<const void> {typedef const void type;};
+template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<volatile void> {typedef volatile void type;};
+template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<const volatile void> {typedef const volatile void type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef _Tp&& type;};
-template <> struct _LIBCPP_VISIBLE add_rvalue_reference<void> {typedef void type;};
-template <> struct _LIBCPP_VISIBLE add_rvalue_reference<const void> {typedef const void type;};
-template <> struct _LIBCPP_VISIBLE add_rvalue_reference<volatile void> {typedef volatile void type;};
-template <> struct _LIBCPP_VISIBLE add_rvalue_reference<const volatile void> {typedef const volatile void type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_rvalue_reference {typedef _Tp&& type;};
+template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<void> {typedef void type;};
+template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<const void> {typedef const void type;};
+template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<volatile void> {typedef volatile void type;};
+template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<const volatile void> {typedef const volatile void type;};
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -511,15 +511,15 @@ struct __any
// remove_pointer
-template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp*> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* const> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* volatile> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* const volatile> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp*> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* const> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* volatile> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* const volatile> {typedef _Tp type;};
// add_pointer
-template <class _Tp> struct _LIBCPP_VISIBLE add_pointer
+template <class _Tp> struct _LIBCPP_TYPE_VIS add_pointer
{typedef typename remove_reference<_Tp>::type* type;};
// is_signed
@@ -535,7 +535,7 @@ struct __is_signed : public ___is_signed<_Tp> {};
template <class _Tp> struct __is_signed<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_signed : public __is_signed<_Tp> {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_signed : public __is_signed<_Tp> {};
// is_unsigned
@@ -550,46 +550,46 @@ struct __is_unsigned : public ___is_unsigned<_Tp> {};
template <class _Tp> struct __is_unsigned<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_unsigned : public __is_unsigned<_Tp> {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_unsigned : public __is_unsigned<_Tp> {};
// rank
-template <class _Tp> struct _LIBCPP_VISIBLE rank
+template <class _Tp> struct _LIBCPP_TYPE_VIS rank
: public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_VISIBLE rank<_Tp[]>
+template <class _Tp> struct _LIBCPP_TYPE_VIS rank<_Tp[]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE rank<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS rank<_Tp[_Np]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
// extent
-template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_VISIBLE extent
+template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TYPE_VIS extent
: public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_VISIBLE extent<_Tp[], 0>
+template <class _Tp> struct _LIBCPP_TYPE_VIS extent<_Tp[], 0>
: public integral_constant<size_t, 0> {};
-template <class _Tp, unsigned _Ip> struct _LIBCPP_VISIBLE extent<_Tp[], _Ip>
+template <class _Tp, unsigned _Ip> struct _LIBCPP_TYPE_VIS extent<_Tp[], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE extent<_Tp[_Np], 0>
+template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS extent<_Tp[_Np], 0>
: public integral_constant<size_t, _Np> {};
-template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_VISIBLE extent<_Tp[_Np], _Ip>
+template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS extent<_Tp[_Np], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
// remove_extent
-template <class _Tp> struct _LIBCPP_VISIBLE remove_extent
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_extent
{typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_extent<_Tp[]>
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_extent<_Tp[]>
{typedef _Tp type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE remove_extent<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS remove_extent<_Tp[_Np]>
{typedef _Tp type;};
// remove_all_extents
-template <class _Tp> struct _LIBCPP_VISIBLE remove_all_extents
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_all_extents
{typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[]>
+template <class _Tp> struct _LIBCPP_TYPE_VIS remove_all_extents<_Tp[]>
{typedef typename remove_all_extents<_Tp>::type type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS remove_all_extents<_Tp[_Np]>
{typedef typename remove_all_extents<_Tp>::type type;};
// is_abstract
@@ -605,14 +605,14 @@ struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_i
template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_abstract : public __libcpp_abstract<_Tp> {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_abstract : public __libcpp_abstract<_Tp> {};
// is_base_of
#ifdef _LIBCP_HAS_IS_BASE_OF
template <class _Bp, class _Dp>
-struct _LIBCPP_VISIBLE is_base_of
+struct _LIBCPP_TYPE_VIS is_base_of
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
#else // __has_feature(is_base_of)
@@ -636,7 +636,7 @@ template <class _Bp, class _Dp> __two __test(...);
}
template <class _Bp, class _Dp>
-struct _LIBCPP_VISIBLE is_base_of
+struct _LIBCPP_TYPE_VIS is_base_of
: public integral_constant<bool, is_class<_Bp>::value &&
sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
@@ -646,7 +646,7 @@ struct _LIBCPP_VISIBLE is_base_of
#if __has_feature(is_convertible_to)
-template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
+template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS is_convertible
: public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
!is_abstract<_T2>::value> {};
@@ -752,7 +752,7 @@ template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
-template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
+template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS is_convertible
: public __is_convertible<_T1, _T2>
{
static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
@@ -766,7 +766,7 @@ template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
#if __has_feature(is_empty)
template <class _Tp>
-struct _LIBCPP_VISIBLE is_empty
+struct _LIBCPP_TYPE_VIS is_empty
: public integral_constant<bool, __is_empty(_Tp)> {};
#else // __has_feature(is_empty)
@@ -788,7 +788,7 @@ struct __libcpp_empty : public integral_constant<bool, sizeof(__is_empty1<_Tp>)
template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp> {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_empty : public __libcpp_empty<_Tp> {};
#endif // __has_feature(is_empty)
@@ -797,7 +797,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp
#if __has_feature(is_polymorphic)
template <class _Tp>
-struct _LIBCPP_VISIBLE is_polymorphic
+struct _LIBCPP_TYPE_VIS is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)> {};
#else
@@ -811,7 +811,7 @@ struct __libcpp_polymorphic
template <class _Tp> struct __libcpp_polymorphic<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_polymorphic
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_polymorphic
: public __libcpp_polymorphic<_Tp> {};
#endif // __has_feature(is_polymorphic)
@@ -820,12 +820,12 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_polymorphic
#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
+template <class _Tp> struct _LIBCPP_TYPE_VIS has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
-template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
+template <class _Tp> struct _LIBCPP_TYPE_VIS has_virtual_destructor
: public false_type {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@@ -834,7 +834,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
template <class _Tp> struct __alignment_of {_Tp __lx;};
-template <class _Tp> struct _LIBCPP_VISIBLE alignment_of
+template <class _Tp> struct _LIBCPP_TYPE_VIS alignment_of
: public integral_constant<size_t, __alignof__(__alignment_of<typename remove_all_extents<_Tp>::type>)> {};
// aligned_storage
@@ -922,7 +922,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
template <size_t _Len, const size_t _Align = __find_max_align<__all_types, _Len>::value>
-struct _LIBCPP_VISIBLE aligned_storage
+struct _LIBCPP_TYPE_VIS aligned_storage
{
typedef typename __find_pod<__all_types, _Align>::type _Aligner;
static_assert(!is_void<_Aligner>::value, "");
@@ -935,7 +935,7 @@ struct _LIBCPP_VISIBLE aligned_storage
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
template <size_t _Len>\
-struct _LIBCPP_VISIBLE aligned_storage<_Len, n>\
+struct _LIBCPP_TYPE_VIS aligned_storage<_Len, n>\
{\
struct _ALIGNAS(n) type\
{\
@@ -1118,7 +1118,7 @@ template <> struct __make_signed< signed long long, true> {typedef long long ty
template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
template <class _Tp>
-struct _LIBCPP_VISIBLE make_signed
+struct _LIBCPP_TYPE_VIS make_signed
{
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
};
@@ -1143,7 +1143,7 @@ template <> struct __make_unsigned< signed long long, true> {typedef unsigned l
template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
template <class _Tp>
-struct _LIBCPP_VISIBLE make_unsigned
+struct _LIBCPP_TYPE_VIS make_unsigned
{
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
};
@@ -1151,21 +1151,21 @@ struct _LIBCPP_VISIBLE make_unsigned
#ifdef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Up = void, class V = void>
-struct _LIBCPP_VISIBLE common_type
+struct _LIBCPP_TYPE_VIS common_type
{
public:
typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type;
};
template <class _Tp>
-struct _LIBCPP_VISIBLE common_type<_Tp, void, void>
+struct _LIBCPP_TYPE_VIS common_type<_Tp, void, void>
{
public:
typedef _Tp type;
};
template <class _Tp, class _Up>
-struct _LIBCPP_VISIBLE common_type<_Tp, _Up, void>
+struct _LIBCPP_TYPE_VIS common_type<_Tp, _Up, void>
{
private:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1184,13 +1184,13 @@ public:
template <class ..._Tp> struct common_type;
template <class _Tp>
-struct _LIBCPP_VISIBLE common_type<_Tp>
+struct _LIBCPP_TYPE_VIS common_type<_Tp>
{
typedef _Tp type;
};
template <class _Tp, class _Up>
-struct _LIBCPP_VISIBLE common_type<_Tp, _Up>
+struct _LIBCPP_TYPE_VIS common_type<_Tp, _Up>
{
private:
static _Tp&& __t();
@@ -1201,7 +1201,7 @@ public:
};
template <class _Tp, class _Up, class ..._Vp>
-struct _LIBCPP_VISIBLE common_type<_Tp, _Up, _Vp...>
+struct _LIBCPP_TYPE_VIS common_type<_Tp, _Up, _Vp...>
{
typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
};
@@ -1245,13 +1245,13 @@ struct is_assignable
// is_copy_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_copy_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
const typename add_lvalue_reference<_Tp>::type> {};
// is_move_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_move_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_move_assignable
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
const typename add_rvalue_reference<_Tp>::type> {};
@@ -1366,7 +1366,7 @@ public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-struct _LIBCPP_VISIBLE decay
+struct _LIBCPP_TYPE_VIS decay
{
private:
typedef typename remove_reference<_Tp>::type _Up;
@@ -1745,7 +1745,7 @@ class __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true> // _Fn must be member p
// result_of
template <class _Fn>
-class _LIBCPP_VISIBLE result_of<_Fn()>
+class _LIBCPP_TYPE_VIS result_of<_Fn()>
: public __result_of<_Fn(),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_reference<_Fn>::type>::value,
@@ -1755,7 +1755,7 @@ class _LIBCPP_VISIBLE result_of<_Fn()>
};
template <class _Fn, class _A0>
-class _LIBCPP_VISIBLE result_of<_Fn(_A0)>
+class _LIBCPP_TYPE_VIS result_of<_Fn(_A0)>
: public __result_of<_Fn(_A0),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_reference<_Fn>::type>::value,
@@ -1765,7 +1765,7 @@ class _LIBCPP_VISIBLE result_of<_Fn(_A0)>
};
template <class _Fn, class _A0, class _A1>
-class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1)>
+class _LIBCPP_TYPE_VIS result_of<_Fn(_A0, _A1)>
: public __result_of<_Fn(_A0, _A1),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_reference<_Fn>::type>::value,
@@ -1775,7 +1775,7 @@ class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1)>
};
template <class _Fn, class _A0, class _A1, class _A2>
-class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1, _A2)>
+class _LIBCPP_TYPE_VIS result_of<_Fn(_A0, _A1, _A2)>
: public __result_of<_Fn(_A0, _A1, _A2),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_reference<_Fn>::type>::value,
@@ -1880,7 +1880,7 @@ struct __contains_void<_A0, _Args...>
// is_constructible entry point
template <class _Tp, class... _Args>
-struct _LIBCPP_VISIBLE is_constructible
+struct _LIBCPP_TYPE_VIS is_constructible
: public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
|| is_abstract<_Tp>::value,
_Tp, _Args...>
@@ -2028,7 +2028,7 @@ struct __nat {};
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_VISIBLE is_constructible
+struct _LIBCPP_TYPE_VIS is_constructible
: public __is_constructible2_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value
@@ -2038,7 +2038,7 @@ struct _LIBCPP_VISIBLE is_constructible
{};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat>
+struct _LIBCPP_TYPE_VIS is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat>
: public __is_constructible0_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value,
@@ -2046,7 +2046,7 @@ struct _LIBCPP_VISIBLE is_constructible<_Tp, __is_construct::__nat, __is_constru
{};
template <class _Tp, class _A0>
-struct _LIBCPP_VISIBLE is_constructible<_Tp, _A0, __is_construct::__nat>
+struct _LIBCPP_TYPE_VIS is_constructible<_Tp, _A0, __is_construct::__nat>
: public __is_constructible1_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value
@@ -2094,21 +2094,21 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
// is_default_constructible
template <class _Tp>
-struct _LIBCPP_VISIBLE is_default_constructible
+struct _LIBCPP_TYPE_VIS is_default_constructible
: public is_constructible<_Tp>
{};
// is_copy_constructible
template <class _Tp>
-struct _LIBCPP_VISIBLE is_copy_constructible
+struct _LIBCPP_TYPE_VIS is_copy_constructible
: public is_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
{};
// is_move_constructible
template <class _Tp>
-struct _LIBCPP_VISIBLE is_move_constructible
+struct _LIBCPP_TYPE_VIS is_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -2123,7 +2123,7 @@ struct _LIBCPP_VISIBLE is_move_constructible
#if __has_feature(is_trivially_constructible)
template <class _Tp, class... _Args>
-struct _LIBCPP_VISIBLE is_trivially_constructible
+struct _LIBCPP_TYPE_VIS is_trivially_constructible
: integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
{
};
@@ -2131,13 +2131,13 @@ struct _LIBCPP_VISIBLE is_trivially_constructible
#else // !__has_feature(is_trivially_constructible)
template <class _Tp, class... _Args>
-struct _LIBCPP_VISIBLE is_trivially_constructible
+struct _LIBCPP_TYPE_VIS is_trivially_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp>
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp>
#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_trivial_constructor(_Tp)>
#else
@@ -2148,22 +2148,22 @@ struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp>
template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&&>
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&&>
#else
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp>
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp>
#endif
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, const _Tp&>
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&>
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
@@ -2174,7 +2174,7 @@ struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&>
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_VISIBLE is_trivially_constructible
+struct _LIBCPP_TYPE_VIS is_trivially_constructible
: false_type
{
};
@@ -2182,28 +2182,28 @@ struct _LIBCPP_VISIBLE is_trivially_constructible
#if __has_feature(is_trivially_constructible)
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp)>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, _Tp)>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&)>
{
@@ -2212,28 +2212,28 @@ struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&,
#else // !__has_feature(is_trivially_constructible)
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&,
+struct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
@@ -2245,19 +2245,19 @@ struct _LIBCPP_VISIBLE is_trivially_constructible<_Tp, _Tp&,
// is_trivially_default_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_default_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_default_constructible
: public is_trivially_constructible<_Tp>
{};
// is_trivially_copy_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_copy_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copy_constructible
: public is_trivially_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
{};
// is_trivially_move_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_move_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -2305,14 +2305,14 @@ struct is_trivially_assignable<_Tp&, _Tp&&>
// is_trivially_copy_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_copy_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copy_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
const typename add_lvalue_reference<_Tp>::type>
{};
// is_trivially_move_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_move_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_move_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typename add_rvalue_reference<_Tp>::type>
@@ -2325,7 +2325,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_move_assignable
#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_destructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_destructible
: public integral_constant<bool, __has_trivial_destructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
@@ -2334,7 +2334,7 @@ template <class _Tp> struct __libcpp_trivial_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_destructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_destructible
: public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@@ -2360,13 +2360,13 @@ struct __is_nothrow_constructible<false, _Tp, _Args...>
};
template <class _Tp, class... _Args>
-struct _LIBCPP_VISIBLE is_nothrow_constructible
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible
: __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
{
};
template <class _Tp, size_t _Ns>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp[_Ns]>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp[_Ns]>
: __is_nothrow_constructible<is_constructible<_Tp>::value, _Tp>
{
};
@@ -2374,13 +2374,13 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp[_Ns]>
#else // __has_feature(cxx_noexcept)
template <class _Tp, class... _Args>
-struct _LIBCPP_VISIBLE is_nothrow_constructible
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp>
#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
#else
@@ -2391,9 +2391,9 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp>
template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp&&>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&&>
#else
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp>
#endif
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -2404,7 +2404,7 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp>
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, const _Tp&>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, const _Tp&>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
@@ -2414,7 +2414,7 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, const _Tp&>
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp&>
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
@@ -2429,13 +2429,13 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp&>
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_VISIBLE is_nothrow_constructible
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
@@ -2446,7 +2446,7 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, __is_construct::__nat,
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp,
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -2457,7 +2457,7 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp,
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, const _Tp&,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -2468,7 +2468,7 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, const _Tp&,
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp&,
+struct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -2482,19 +2482,19 @@ struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp, _Tp&,
// is_nothrow_default_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_default_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_default_constructible
: public is_nothrow_constructible<_Tp>
{};
// is_nothrow_copy_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_copy_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_copy_constructible
: public is_nothrow_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
{};
// is_nothrow_move_constructible
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_move_constructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -2521,7 +2521,7 @@ struct __is_nothrow_assignable<true, _Tp, _Arg>
};
template <class _Tp, class _Arg>
-struct _LIBCPP_VISIBLE is_nothrow_assignable
+struct _LIBCPP_TYPE_VIS is_nothrow_assignable
: public __is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
{
};
@@ -2529,11 +2529,11 @@ struct _LIBCPP_VISIBLE is_nothrow_assignable
#else // __has_feature(cxx_noexcept)
template <class _Tp, class _Arg>
-struct _LIBCPP_VISIBLE is_nothrow_assignable
+struct _LIBCPP_TYPE_VIS is_nothrow_assignable
: public false_type {};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_assignable<_Tp&, _Tp>
+struct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, _Tp>
#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -2541,7 +2541,7 @@ struct _LIBCPP_VISIBLE is_nothrow_assignable<_Tp&, _Tp>
#endif
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_assignable<_Tp&, _Tp&>
+struct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, _Tp&>
#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -2549,7 +2549,7 @@ struct _LIBCPP_VISIBLE is_nothrow_assignable<_Tp&, _Tp&>
#endif
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_assignable<_Tp&, const _Tp&>
+struct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, const _Tp&>
#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -2572,14 +2572,14 @@ struct is_nothrow_assignable<_Tp&, _Tp&&>
// is_nothrow_copy_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_copy_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_copy_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
const typename add_lvalue_reference<_Tp>::type>
{};
// is_nothrow_move_assignable
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_move_assignable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_move_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typename add_rvalue_reference<_Tp>::type>
@@ -2607,19 +2607,19 @@ struct __is_nothrow_destructible<true, _Tp>
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_destructible
+struct _LIBCPP_TYPE_VIS is_nothrow_destructible
: public __is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
{
};
template <class _Tp, size_t _Ns>
-struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp[_Ns]>
+struct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp[_Ns]>
: public is_nothrow_destructible<_Tp>
{
};
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp&>
+struct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp&>
: public true_type
{
};
@@ -2627,7 +2627,7 @@ struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp&>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp&&>
+struct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp&&>
: public true_type
{
};
@@ -2640,7 +2640,7 @@ template <class _Tp> struct __libcpp_nothrow_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_destructible
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_destructible
: public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
#endif
@@ -2649,12 +2649,12 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_nothrow_destructible
#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-template <class _Tp> struct _LIBCPP_VISIBLE is_pod
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_pod
: public integral_constant<bool, __is_pod(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
-template <class _Tp> struct _LIBCPP_VISIBLE is_pod
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_pod
: public integral_constant<bool, is_trivially_default_constructible<_Tp>::value &&
is_trivially_copy_constructible<_Tp>::value &&
is_trivially_copy_assignable<_Tp>::value &&
@@ -2664,7 +2664,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_pod
// is_literal_type;
-template <class _Tp> struct _LIBCPP_VISIBLE is_literal_type
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_literal_type
#if __has_feature(is_literal)
: public integral_constant<bool, __is_literal(_Tp)>
#else
@@ -2675,7 +2675,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_literal_type
// is_standard_layout;
-template <class _Tp> struct _LIBCPP_VISIBLE is_standard_layout
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_standard_layout
#if __has_feature(is_standard_layout)
: public integral_constant<bool, __is_standard_layout(_Tp)>
#else
@@ -2685,7 +2685,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_standard_layout
// is_trivially_copyable;
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_copyable
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copyable
#if __has_feature(is_trivially_copyable)
: public integral_constant<bool, __is_trivially_copyable(_Tp)>
#else
@@ -2695,7 +2695,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_copyable
// is_trivial;
-template <class _Tp> struct _LIBCPP_VISIBLE is_trivial
+template <class _Tp> struct _LIBCPP_TYPE_VIS is_trivial
#if __has_feature(is_trivial)
: public integral_constant<bool, __is_trivial(_Tp)>
#else
@@ -2924,7 +2924,7 @@ struct __invoke_of
};
template <class _Fp, class ..._Args>
-class _LIBCPP_VISIBLE result_of<_Fp(_Args...)>
+class _LIBCPP_TYPE_VIS result_of<_Fp(_Args...)>
: public __invoke_of<_Fp, _Args...>
{
};
diff --git a/system/include/libcxx/typeindex b/system/include/libcxx/typeindex
index 398b5288..67462b74 100644
--- a/system/include/libcxx/typeindex
+++ b/system/include/libcxx/typeindex
@@ -55,7 +55,7 @@ struct hash<type_index>
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_VISIBLE type_index
+class _LIBCPP_TYPE_VIS type_index
{
const type_info* __t_;
public:
@@ -87,10 +87,10 @@ public:
const char* name() const _NOEXCEPT {return __t_->name();}
};
-template <class _Tp> struct _LIBCPP_VISIBLE hash;
+template <class _Tp> struct _LIBCPP_TYPE_VIS hash;
template <>
-struct _LIBCPP_VISIBLE hash<type_index>
+struct _LIBCPP_TYPE_VIS hash<type_index>
: public unary_function<type_index, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/system/include/libcxx/unordered_map b/system/include/libcxx/unordered_map
index cb2ab42a..235b2eab 100644
--- a/system/include/libcxx/unordered_map
+++ b/system/include/libcxx/unordered_map
@@ -544,7 +544,7 @@ public:
};
template <class _HashIterator>
-class _LIBCPP_VISIBLE __hash_map_iterator
+class _LIBCPP_TYPE_VIS __hash_map_iterator
{
_HashIterator __i_;
@@ -592,15 +592,15 @@ public:
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
};
template <class _HashIterator>
-class _LIBCPP_VISIBLE __hash_map_const_iterator
+class _LIBCPP_TYPE_VIS __hash_map_const_iterator
{
_HashIterator __i_;
@@ -653,15 +653,15 @@ public:
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
- template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE unordered_map
+class _LIBCPP_TYPE_VIS unordered_map
{
public:
// types
@@ -1294,7 +1294,7 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_VISIBLE unordered_multimap
+class _LIBCPP_TYPE_VIS unordered_multimap
{
public:
// types
diff --git a/system/include/libcxx/unordered_set b/system/include/libcxx/unordered_set
index 279e9072..119251dc 100644
--- a/system/include/libcxx/unordered_set
+++ b/system/include/libcxx/unordered_set
@@ -313,7 +313,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_VISIBLE unordered_set
+class _LIBCPP_TYPE_VIS unordered_set
{
public:
// types
@@ -725,7 +725,7 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_VISIBLE unordered_multiset
+class _LIBCPP_TYPE_VIS unordered_multiset
{
public:
// types
diff --git a/system/include/libcxx/utility b/system/include/libcxx/utility
index 514ce17f..2df4b361 100644
--- a/system/include/libcxx/utility
+++ b/system/include/libcxx/utility
@@ -205,7 +205,7 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
return _VSTD::move(__x);
}
-struct _LIBCPP_VISIBLE piecewise_construct_t { };
+struct _LIBCPP_TYPE_VIS piecewise_construct_t { };
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
@@ -213,7 +213,7 @@ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
template <class _T1, class _T2>
-struct _LIBCPP_VISIBLE pair
+struct _LIBCPP_TYPE_VIS pair
{
typedef _T1 first_type;
typedef _T2 second_type;
@@ -419,7 +419,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
+template <class _Tp> class _LIBCPP_TYPE_VIS reference_wrapper;
template <class _Tp>
struct ___make_pair_return
@@ -461,36 +461,36 @@ make_pair(_T1 __x, _T2 __y)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _T1, class _T2>
- class _LIBCPP_VISIBLE tuple_size<pair<_T1, _T2> >
+ class _LIBCPP_TYPE_VIS tuple_size<pair<_T1, _T2> >
: public integral_constant<size_t, 2> {};
template <class _T1, class _T2>
- class _LIBCPP_VISIBLE tuple_size<const pair<_T1, _T2> >
+ class _LIBCPP_TYPE_VIS tuple_size<const pair<_T1, _T2> >
: public integral_constant<size_t, 2> {};
template <class _T1, class _T2>
-class _LIBCPP_VISIBLE tuple_element<0, pair<_T1, _T2> >
+class _LIBCPP_TYPE_VIS tuple_element<0, pair<_T1, _T2> >
{
public:
typedef _T1 type;
};
template <class _T1, class _T2>
-class _LIBCPP_VISIBLE tuple_element<1, pair<_T1, _T2> >
+class _LIBCPP_TYPE_VIS tuple_element<1, pair<_T1, _T2> >
{
public:
typedef _T2 type;
};
template <class _T1, class _T2>
-class _LIBCPP_VISIBLE tuple_element<0, const pair<_T1, _T2> >
+class _LIBCPP_TYPE_VIS tuple_element<0, const pair<_T1, _T2> >
{
public:
typedef const _T1 type;
};
template <class _T1, class _T2>
-class _LIBCPP_VISIBLE tuple_element<1, const pair<_T1, _T2> >
+class _LIBCPP_TYPE_VIS tuple_element<1, const pair<_T1, _T2> >
{
public:
typedef const _T2 type;
diff --git a/system/include/libcxx/valarray b/system/include/libcxx/valarray
index c56dd125..71c8a74e 100644
--- a/system/include/libcxx/valarray
+++ b/system/include/libcxx/valarray
@@ -354,9 +354,9 @@ template <class T> unspecified2 end(const valarray<T>& v);
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp> class _LIBCPP_VISIBLE valarray;
+template<class _Tp> class _LIBCPP_TYPE_VIS valarray;
-class _LIBCPP_VISIBLE slice
+class _LIBCPP_TYPE_VIS slice
{
size_t __start_;
size_t __size_;
@@ -381,11 +381,11 @@ public:
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
};
-template <class _Tp> class _LIBCPP_VISIBLE slice_array;
-class _LIBCPP_VISIBLE gslice;
-template <class _Tp> class _LIBCPP_VISIBLE gslice_array;
-template <class _Tp> class _LIBCPP_VISIBLE mask_array;
-template <class _Tp> class _LIBCPP_VISIBLE indirect_array;
+template <class _Tp> class _LIBCPP_TYPE_VIS slice_array;
+class _LIBCPP_TYPE_VIS gslice;
+template <class _Tp> class _LIBCPP_TYPE_VIS gslice_array;
+template <class _Tp> class _LIBCPP_TYPE_VIS mask_array;
+template <class _Tp> class _LIBCPP_TYPE_VIS indirect_array;
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
@@ -671,7 +671,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __size_;}
- template <class> friend class _LIBCPP_VISIBLE valarray;
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
};
template <class _ValExpr>
@@ -786,7 +786,7 @@ template<class _Tp>
struct __is_val_expr<valarray<_Tp> > : true_type {};
template<class _Tp>
-class _LIBCPP_VISIBLE valarray
+class _LIBCPP_TYPE_VIS valarray
{
public:
typedef _Tp value_type;
@@ -976,12 +976,12 @@ public:
void resize(size_t __n, value_type __x = value_type());
private:
- template <class> friend class _LIBCPP_VISIBLE valarray;
- template <class> friend class _LIBCPP_VISIBLE slice_array;
- template <class> friend class _LIBCPP_VISIBLE gslice_array;
- template <class> friend class _LIBCPP_VISIBLE mask_array;
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
+ template <class> friend class _LIBCPP_TYPE_VIS slice_array;
+ template <class> friend class _LIBCPP_TYPE_VIS gslice_array;
+ template <class> friend class _LIBCPP_TYPE_VIS mask_array;
template <class> friend class __mask_expr;
- template <class> friend class _LIBCPP_VISIBLE indirect_array;
+ template <class> friend class _LIBCPP_TYPE_VIS indirect_array;
template <class> friend class __indirect_expr;
template <class> friend class __val_expr;
@@ -1091,7 +1091,7 @@ struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
// slice_array
template <class _Tp>
-class _LIBCPP_VISIBLE slice_array
+class _LIBCPP_TYPE_VIS slice_array
{
public:
typedef _Tp value_type;
@@ -1394,7 +1394,7 @@ slice_array<_Tp>::operator=(const value_type& __x) const
// gslice
-class _LIBCPP_VISIBLE gslice
+class _LIBCPP_TYPE_VIS gslice
{
valarray<size_t> __size_;
valarray<size_t> __stride_;
@@ -1461,7 +1461,7 @@ private:
// gslice_array
template <class _Tp>
-class _LIBCPP_VISIBLE gslice_array
+class _LIBCPP_TYPE_VIS gslice_array
{
public:
typedef _Tp value_type;
@@ -1790,7 +1790,7 @@ gslice_array<_Tp>::operator=(const value_type& __x) const
// mask_array
template <class _Tp>
-class _LIBCPP_VISIBLE mask_array
+class _LIBCPP_TYPE_VIS mask_array
{
public:
typedef _Tp value_type;
@@ -2134,7 +2134,7 @@ public:
// indirect_array
template <class _Tp>
-class _LIBCPP_VISIBLE indirect_array
+class _LIBCPP_TYPE_VIS indirect_array
{
public:
typedef _Tp value_type;
@@ -2485,7 +2485,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __1d_.size();}
- template <class> friend class _LIBCPP_VISIBLE valarray;
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
};
template<class _ValExpr>
diff --git a/system/include/libcxx/vector b/system/include/libcxx/vector
index 876b7e56..d1bc23e6 100644
--- a/system/include/libcxx/vector
+++ b/system/include/libcxx/vector
@@ -481,7 +481,7 @@ __vector_base<_Tp, _Allocator>::~__vector_base()
}
template <class _Tp, class _Allocator = allocator<_Tp> >
-class _LIBCPP_VISIBLE vector
+class _LIBCPP_TYPE_VIS vector
: private __vector_base<_Tp, _Allocator>
{
private:
@@ -502,6 +502,9 @@ public:
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
_LIBCPP_INLINE_VISIBILITY
vector()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
@@ -523,17 +526,29 @@ public:
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
typename enable_if<__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value>::type* = 0);
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
typename enable_if<__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value>::type* = 0);
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);
template <class _ForwardIterator>
vector(_ForwardIterator __first, _ForwardIterator __last,
- typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
+ typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
template <class _ForwardIterator>
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
- typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
+ typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
vector(initializer_list<value_type> __il);
@@ -574,14 +589,20 @@ public:
typename enable_if
<
__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value,
void
>::type
assign(_InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value,
void
>::type
assign(_ForwardIterator __first, _ForwardIterator __last);
@@ -697,14 +718,20 @@ public:
typename enable_if
<
__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value,
iterator
>::type
insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value,
iterator
>::type
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
@@ -1031,7 +1058,10 @@ template <class _Tp, class _Allocator>
template <class _InputIterator>
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
typename enable_if<__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value>::type*)
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value>::type*)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1044,7 +1074,10 @@ template <class _Tp, class _Allocator>
template <class _InputIterator>
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
typename enable_if<__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value>::type*)
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_InputIterator>::reference>::value>::type*)
: __base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1057,7 +1090,10 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
template <class _Tp, class _Allocator>
template <class _ForwardIterator>
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
- typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
+ typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1073,7 +1109,10 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
template <class _Tp, class _Allocator>
template <class _ForwardIterator>
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
- typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
+ typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ value_type,
+ typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
: __base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1255,7 +1294,10 @@ template <class _InputIterator>
typename enable_if
<
__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ _Tp,
+ typename iterator_traits<_InputIterator>::reference>::value,
void
>::type
vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
@@ -1269,7 +1311,10 @@ template <class _Tp, class _Allocator>
template <class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ _Tp,
+ typename iterator_traits<_ForwardIterator>::reference>::value,
void
>::type
vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
@@ -1550,6 +1595,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
"vector::erase(iterator) called with an iterator not"
" referring to this vector");
#endif
+ _LIBCPP_ASSERT(__position != end(),
+ "vector::erase(iterator) called with a non-dereferenceable iterator");
pointer __p = const_cast<pointer>(&*__position);
iterator __r = __make_iter(__p);
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
@@ -1748,7 +1795,10 @@ template <class _InputIterator>
typename enable_if
<
__is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ !__is_forward_iterator<_InputIterator>::value &&
+ is_constructible<
+ _Tp,
+ typename iterator_traits<_InputIterator>::reference>::value,
typename vector<_Tp, _Allocator>::iterator
>::type
vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
@@ -1800,7 +1850,10 @@ template <class _Tp, class _Allocator>
template <class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value &&
+ is_constructible<
+ _Tp,
+ typename iterator_traits<_ForwardIterator>::reference>::value,
typename vector<_Tp, _Allocator>::iterator
>::type
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
@@ -1963,7 +2016,7 @@ struct __has_storage_type<vector<bool, _Allocator> >
};
template <class _Allocator>
-class _LIBCPP_VISIBLE vector<bool, _Allocator>
+class _LIBCPP_TYPE_VIS vector<bool, _Allocator>
: private __vector_base_common<true>
{
public:
@@ -2321,7 +2374,7 @@ private:
friend class __bit_iterator<vector, false>;
friend class __bit_iterator<vector, true>;
friend struct __bit_array<vector>;
- friend struct _LIBCPP_VISIBLE hash<vector>;
+ friend struct _LIBCPP_TYPE_VIS hash<vector>;
};
template <class _Allocator>
@@ -3104,7 +3157,7 @@ vector<bool, _Allocator>::__hash_code() const _NOEXCEPT
}
template <class _Allocator>
-struct _LIBCPP_VISIBLE hash<vector<bool, _Allocator> >
+struct _LIBCPP_TYPE_VIS hash<vector<bool, _Allocator> >
: public unary_function<vector<bool, _Allocator>, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/system/lib/libcxx/chrono.cpp b/system/lib/libcxx/chrono.cpp
index 1ce2e280..15a6f466 100644
--- a/system/lib/libcxx/chrono.cpp
+++ b/system/lib/libcxx/chrono.cpp
@@ -9,7 +9,7 @@
#include "chrono"
#include <sys/time.h> //for gettimeofday and timeval
-#if __APPLE__
+#ifdef __APPLE__
#include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
#else /* !__APPLE__ */
#include <cerrno> // errno
@@ -50,7 +50,7 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
const bool steady_clock::is_steady;
-#if __APPLE__
+#ifdef __APPLE__
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
// are run time constants supplied by the OS. This clock has no relationship
diff --git a/system/lib/libcxx/debug.cpp b/system/lib/libcxx/debug.cpp
index f3a0262d..2d4b094b 100644
--- a/system/lib/libcxx/debug.cpp
+++ b/system/lib/libcxx/debug.cpp
@@ -17,7 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
__libcpp_db*
__get_db()
{
@@ -25,7 +25,7 @@ __get_db()
return &db;
}
-_LIBCPP_VISIBLE
+_LIBCPP_FUNC_VIS
const __libcpp_db*
__get_const_db()
{
diff --git a/system/lib/libcxx/exception.cpp b/system/lib/libcxx/exception.cpp
index 8d5ded4d..1d2f6b25 100644
--- a/system/lib/libcxx/exception.cpp
+++ b/system/lib/libcxx/exception.cpp
@@ -14,7 +14,7 @@
#define __has_include(inc) 0
#endif
-#if __APPLE__
+#ifdef __APPLE__
#include <cxxabi.h>
using namespace __cxxabiv1;
@@ -104,7 +104,7 @@ terminate() _NOEXCEPT
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN)
bool uncaught_exception() _NOEXCEPT
{
-#if __APPLE__ || defined(_LIBCPPABI_VERSION)
+#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION)
// on Darwin, there is a helper function so __cxa_get_globals is private
return __cxa_uncaught_exception();
#else // __APPLE__
diff --git a/system/lib/libcxx/iostream.cpp b/system/lib/libcxx/iostream.cpp
index f5b959b4..7fc71df4 100644
--- a/system/lib/libcxx/iostream.cpp
+++ b/system/lib/libcxx/iostream.cpp
@@ -13,6 +13,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+static mbstate_t state_types[6] = {};
+
_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
@@ -33,17 +35,17 @@ ios_base::Init __start_std_streams;
ios_base::Init::Init()
{
- istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin) );
- ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout));
- ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr));
+ istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin, state_types+0) );
+ ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout, state_types+1));
+ ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr, state_types+2));
::new(clog) ostream(cerr_ptr->rdbuf());
cin_ptr->tie(cout_ptr);
_VSTD::unitbuf(*cerr_ptr);
cerr_ptr->tie(cout_ptr);
- wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin) );
- wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout));
- wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr));
+ wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin, state_types+3) );
+ wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout, state_types+4));
+ wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr, state_types+5));
::new(wclog) wostream(wcerr_ptr->rdbuf());
wcin_ptr->tie(wcout_ptr);
_VSTD::unitbuf(*wcerr_ptr);
diff --git a/system/lib/libcxx/locale.cpp b/system/lib/libcxx/locale.cpp
index 35a65086..d9bc6f9a 100644
--- a/system/lib/libcxx/locale.cpp
+++ b/system/lib/libcxx/locale.cpp
@@ -25,7 +25,7 @@
#include "cstring"
#include "cwctype"
#include "__sso_allocator"
-#if _WIN32
+#ifdef _WIN32
#include <support/win32/locale_win32.h>
#else // _WIN32
#include <langinfo.h>
@@ -993,11 +993,11 @@ ctype<char>::classic_table() _NOEXCEPT
return __cloc()->__ctype_b;
#elif __sun__
return __ctype_mask;
-#elif _WIN32
+#elif defined(_WIN32)
return _ctype+1; // internal ctype mask table defined in msvcrt.dll
// This is assumed to be safe, which is a nonsense assumption because we're
// going to end up dereferencing it later...
-#elif EMSCRIPTEN
+#elif defined(EMSCRIPTEN)
return *__ctype_b_loc();
#else
// Platform not supported: abort so the person doing the port knows what to
@@ -5801,7 +5801,7 @@ moneypunct_byname<char, true>::init(const char* nm)
__frac_digits_ = lc->int_frac_digits;
else
__frac_digits_ = base::do_frac_digits();
-#if _WIN32
+#ifdef _WIN32
if (lc->p_sign_posn == 0)
#else // _WIN32
if (lc->int_p_sign_posn == 0)
@@ -5809,7 +5809,7 @@ moneypunct_byname<char, true>::init(const char* nm)
__positive_sign_ = "()";
else
__positive_sign_ = lc->positive_sign;
-#if _WIN32
+#ifdef _WIN32
if(lc->n_sign_posn == 0)
#else // _WIN32
if (lc->int_n_sign_posn == 0)
@@ -5821,7 +5821,7 @@ moneypunct_byname<char, true>::init(const char* nm)
// the same places in curr_symbol since there's no way to
// represent anything else.
string_type __dummy_curr_symbol = __curr_symbol_;
-#if _WIN32
+#ifdef _WIN32
__init_pat(__pos_format_, __dummy_curr_symbol, true,
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, ' ');
__init_pat(__neg_format_, __curr_symbol_, true,
@@ -5960,7 +5960,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
__frac_digits_ = lc->int_frac_digits;
else
__frac_digits_ = base::do_frac_digits();
-#if _WIN32
+#ifdef _WIN32
if (lc->p_sign_posn == 0)
#else // _WIN32
if (lc->int_p_sign_posn == 0)
@@ -5980,7 +5980,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
wbe = wbuf + j;
__positive_sign_.assign(wbuf, wbe);
}
-#if _WIN32
+#ifdef _WIN32
if (lc->n_sign_posn == 0)
#else // _WIN32
if (lc->int_n_sign_posn == 0)
@@ -6004,7 +6004,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
// the same places in curr_symbol since there's no way to
// represent anything else.
string_type __dummy_curr_symbol = __curr_symbol_;
-#if _WIN32
+#ifdef _WIN32
__init_pat(__pos_format_, __dummy_curr_symbol, true,
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, L' ');
__init_pat(__neg_format_, __curr_symbol_, true,
diff --git a/system/lib/libcxx/memory.cpp b/system/lib/libcxx/memory.cpp
index 14084a52..98bcc864 100644
--- a/system/lib/libcxx/memory.cpp
+++ b/system/lib/libcxx/memory.cpp
@@ -122,7 +122,15 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
#if __has_feature(cxx_atomic)
static const std::size_t __sp_mut_count = 16;
-static mutex mut_back[__sp_mut_count];
+static pthread_mutex_t mut_back_imp[__sp_mut_count] =
+{
+ PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
+ PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
+ PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
+ PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER
+};
+
+static mutex* mut_back = reinterpret_cast<std::mutex*>(mut_back_imp);
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
: __lx(p)
diff --git a/system/lib/libcxx/new.cpp b/system/lib/libcxx/new.cpp
index 3ad593a3..b23a516f 100644
--- a/system/lib/libcxx/new.cpp
+++ b/system/lib/libcxx/new.cpp
@@ -15,7 +15,7 @@
#define __has_include(inc) 0
#endif
-#if __APPLE__
+#ifdef __APPLE__
#include <cxxabi.h>
#ifndef _LIBCPPABI_VERSION
diff --git a/system/lib/libcxx/readme.txt b/system/lib/libcxx/readme.txt
index c0c90c3a..97d8db86 100644
--- a/system/lib/libcxx/readme.txt
+++ b/system/lib/libcxx/readme.txt
@@ -1 +1 @@
-These files are from libc++, svn revision 176559, Mar 7 2013
+These files are from libc++, svn revision 178253, Mar 29 2013
diff --git a/system/lib/libcxx/stdexcept.cpp b/system/lib/libcxx/stdexcept.cpp
index 660ebfe2..0c4e8323 100644
--- a/system/lib/libcxx/stdexcept.cpp
+++ b/system/lib/libcxx/stdexcept.cpp
@@ -20,7 +20,7 @@
#define __has_include(inc) 0
#endif
-#if __APPLE__
+#ifdef __APPLE__
#include <cxxabi.h>
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
#include <cxxabi.h>
diff --git a/system/lib/libcxx/string.cpp b/system/lib/libcxx/string.cpp
index 40723e74..c71af4fe 100644
--- a/system/lib/libcxx/string.cpp
+++ b/system/lib/libcxx/string.cpp
@@ -11,7 +11,7 @@
#include "cstdlib"
#include "cwchar"
#include "cerrno"
-#if _WIN32
+#ifdef _WIN32
#include "support/win32/support.h"
#endif // _WIN32
diff --git a/system/lib/libcxx/strstream.cpp b/system/lib/libcxx/strstream.cpp
index 8cd19e6a..518422bd 100644
--- a/system/lib/libcxx/strstream.cpp
+++ b/system/lib/libcxx/strstream.cpp
@@ -158,6 +158,8 @@ strstreambuf::overflow(int_type __c)
return int_type(EOF);
streamsize old_size = (epptr() ? epptr() : egptr()) - eback();
streamsize new_size = max<streamsize>(__alsize_, 2*old_size);
+ if (new_size == 0)
+ new_size = __default_alsize;
char* buf = nullptr;
if (__palloc_)
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size)));
diff --git a/system/lib/libcxx/symbols b/system/lib/libcxx/symbols
index 7e2072bc..93dfda65 100644
--- a/system/lib/libcxx/symbols
+++ b/system/lib/libcxx/symbols
@@ -766,8 +766,8 @@
C _ZNSt3__110__stdinbufIcE9__getcharEb
C _ZNSt3__110__stdinbufIcE9pbackfailEi
C _ZNSt3__110__stdinbufIcE9underflowEv
- C _ZNSt3__110__stdinbufIcEC1EP7__sFILE
- C _ZNSt3__110__stdinbufIcEC2EP7__sFILE
+ C _ZNSt3__110__stdinbufIcEC1EP7__sFILEP10_mbstate_t
+ C _ZNSt3__110__stdinbufIcEC2EP7__sFILEP10_mbstate_t
C _ZNSt3__110__stdinbufIcED0Ev
C _ZNSt3__110__stdinbufIcED1Ev
C _ZNSt3__110__stdinbufIcED2Ev
@@ -776,8 +776,8 @@
C _ZNSt3__110__stdinbufIwE9__getcharEb
C _ZNSt3__110__stdinbufIwE9pbackfailEj
C _ZNSt3__110__stdinbufIwE9underflowEv
- C _ZNSt3__110__stdinbufIwEC1EP7__sFILE
- C _ZNSt3__110__stdinbufIwEC2EP7__sFILE
+ C _ZNSt3__110__stdinbufIwEC1EP7__sFILEP10_mbstate_t
+ C _ZNSt3__110__stdinbufIwEC2EP7__sFILEP10_mbstate_t
C _ZNSt3__110__stdinbufIwED0Ev
C _ZNSt3__110__stdinbufIwED1Ev
C _ZNSt3__110__stdinbufIwED2Ev
@@ -882,16 +882,16 @@
C _ZNSt3__111__stdoutbufIcE4syncEv
C _ZNSt3__111__stdoutbufIcE5imbueERKNS_6localeE
C _ZNSt3__111__stdoutbufIcE8overflowEi
- C _ZNSt3__111__stdoutbufIcEC1EP7__sFILE
- C _ZNSt3__111__stdoutbufIcEC2EP7__sFILE
+ C _ZNSt3__111__stdoutbufIcEC1EP7__sFILEP10_mbstate_t
+ C _ZNSt3__111__stdoutbufIcEC2EP7__sFILEP10_mbstate_t
C _ZNSt3__111__stdoutbufIcED0Ev
C _ZNSt3__111__stdoutbufIcED1Ev
C _ZNSt3__111__stdoutbufIcED2Ev
C _ZNSt3__111__stdoutbufIwE4syncEv
C _ZNSt3__111__stdoutbufIwE5imbueERKNS_6localeE
C _ZNSt3__111__stdoutbufIwE8overflowEj
- C _ZNSt3__111__stdoutbufIwEC1EP7__sFILE
- C _ZNSt3__111__stdoutbufIwEC2EP7__sFILE
+ C _ZNSt3__111__stdoutbufIwEC1EP7__sFILEP10_mbstate_t
+ C _ZNSt3__111__stdoutbufIwEC2EP7__sFILEP10_mbstate_t
C _ZNSt3__111__stdoutbufIwED0Ev
C _ZNSt3__111__stdoutbufIwED1Ev
C _ZNSt3__111__stdoutbufIwED2Ev
@@ -2146,7 +2146,7 @@
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endEj
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE
- C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6assignIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_
+ C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6assignIPS3_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS3_NS_15iterator_traitsISA_E9referenceEEE5valueEvE4typeESA_SA_
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6resizeEj
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8__appendEj
C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8allocateEj
diff --git a/system/lib/libcxx/thread.cpp b/system/lib/libcxx/thread.cpp
index a2d95bb2..76af3d0c 100644
--- a/system/lib/libcxx/thread.cpp
+++ b/system/lib/libcxx/thread.cpp
@@ -13,8 +13,8 @@
#include "future"
#include "limits"
#include <sys/types.h>
-#if !_WIN32
-#if !__sun__ && !__linux__
+#if !defined(_WIN32)
+#if !defined(__sun__) && !defined(__linux__)
#include <sys/sysctl.h>
#else
#include <unistd.h>
diff --git a/system/lib/libcxx/typeinfo.cpp b/system/lib/libcxx/typeinfo.cpp
index 6bab0771..7b47d741 100644
--- a/system/lib/libcxx/typeinfo.cpp
+++ b/system/lib/libcxx/typeinfo.cpp
@@ -12,7 +12,7 @@
#define __has_include(inc) 0
#endif
-#if __APPLE__
+#ifdef __APPLE__
#include <cxxabi.h>
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
#include <cxxabi.h>
@@ -50,7 +50,7 @@ std::bad_typeid::what() const _NOEXCEPT
return "std::bad_typeid";
}
-#if __APPLE__
+#ifdef __APPLE__
// On Darwin, the cxa_bad_* functions cannot be in the lower level library
// because bad_cast and bad_typeid are defined in his higher level library
void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); }
diff --git a/tests/glfw.c b/tests/glfw.c
new file mode 100644
index 00000000..79199d9a
--- /dev/null
+++ b/tests/glfw.c
@@ -0,0 +1,389 @@
+#include <stdlib.h>
+#include <GL/glfw.h>
+#include <stdio.h>
+#include <emscripten/emscripten.h>
+
+void Init(void);
+void Shut_Down(int return_code);
+void Iteration(void);
+void Draw_Square(float red, float green, float blue);
+void Draw(void);
+void OnKeyPressed( int key, int action );
+void OnCharPressed( int character, int action );
+char* GetKeyName(int key);
+char* GetParamName(int param);
+int OnClose();
+void OnResize( int width, int height );
+void OnRefresh();
+void OnMouseClick( int button, int action );
+void OnMouseMove( int x, int y );
+void OnMouseWheel( int pos );
+void PullInfo();
+
+int params[] = {GLFW_OPENED, GLFW_ACTIVE, GLFW_ICONIFIED, GLFW_ACCELERATED, GLFW_RED_BITS, GLFW_GREEN_BITS, GLFW_BLUE_BITS, GLFW_ALPHA_BITS, GLFW_DEPTH_BITS, GLFW_STENCIL_BITS, GLFW_REFRESH_RATE, GLFW_ACCUM_RED_BITS, GLFW_ACCUM_GREEN_BITS, GLFW_ACCUM_BLUE_BITS, GLFW_ACCUM_ALPHA_BITS, GLFW_AUX_BUFFERS, GLFW_STEREO, GLFW_WINDOW_NO_RESIZE, GLFW_FSAA_SAMPLES, GLFW_OPENGL_VERSION_MAJOR, GLFW_OPENGL_VERSION_MINOR, GLFW_OPENGL_FORWARD_COMPAT, GLFW_OPENGL_DEBUG_CONTEXT, GLFW_OPENGL_PROFILE};
+unsigned int nb_params = sizeof(params) / sizeof(int);
+
+int features[] = {GLFW_MOUSE_CURSOR, GLFW_STICKY_KEYS, GLFW_STICKY_MOUSE_BUTTONS, GLFW_SYSTEM_KEYS, GLFW_KEY_REPEAT, GLFW_AUTO_POLL_EVENTS};
+unsigned int nb_features = sizeof(features) / sizeof(int);
+
+float rotate_y = 0,
+ rotate_z = 0;
+const float rotations_per_tick = .2;
+// the time of the previous frame
+double old_time;
+
+int main(void)
+{
+ Init();
+ old_time = glfwGetTime();
+ emscripten_set_main_loop (Iteration, 0, 1);
+ Shut_Down(0);
+}
+
+void Init()
+{
+ const int window_width = 800,
+ window_height = 600;
+
+ if (glfwInit() != GL_TRUE)
+ Shut_Down(1);
+ // 800 x 600, 16 bit color, no depth, alpha or stencil buffers, windowed
+ if (glfwOpenWindow(window_width, window_height, 5, 6, 5,
+ 0, 0, 0, GLFW_WINDOW) != GL_TRUE)
+ Shut_Down(1);
+ glfwSetWindowTitle("The GLFW Window");
+
+ glfwSetKeyCallback( OnKeyPressed );
+ glfwSetCharCallback( OnCharPressed );
+ glfwSetWindowCloseCallback(OnClose);
+ glfwSetWindowSizeCallback(OnResize);
+ glfwSetWindowRefreshCallback(OnRefresh);
+ glfwSetMouseWheelCallback(OnMouseWheel);
+ glfwSetMousePosCallback(OnMouseMove);
+ glfwSetMouseButtonCallback(OnMouseClick);
+
+ // set the projection matrix to a normal frustum with a max depth of 50
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ float aspect_ratio = ((float)window_height) / window_width;
+ glFrustum(.5, -.5, -.5 * aspect_ratio, .5 * aspect_ratio, 1, 50);
+ glMatrixMode(GL_MODELVIEW);
+
+ PullInfo();
+}
+
+void Shut_Down(int return_code)
+{
+ glfwTerminate();
+ exit(return_code);
+}
+
+void Iteration()
+{
+ // calculate time elapsed, and the amount by which stuff rotates
+ double current_time = glfwGetTime(),
+ delta_rotate = (current_time - old_time) * rotations_per_tick * 360;
+ old_time = current_time;
+ if (glfwGetKey(GLFW_KEY_LEFT) == GLFW_PRESS)
+ rotate_y += delta_rotate;
+ if (glfwGetKey(GLFW_KEY_RIGHT) == GLFW_PRESS)
+ rotate_y -= delta_rotate;
+ // z axis always rotates
+ rotate_z += delta_rotate;
+
+ // clear the buffer
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ // draw the figure
+ Draw();
+ // swap back and front buffers
+ glfwSwapBuffers();
+}
+
+void Draw(void)
+{
+ int width, height, x;
+ double t;
+
+ t = glfwGetTime ();
+ glfwGetMousePos (&x, NULL);
+
+ // Get window size (may be different than the requested size)
+ glfwGetWindowSize (&width, &height);
+
+ // Special case: avoid division by zero below
+ height = height > 0 ? height : 1;
+
+ glViewport (0, 0, width, height);
+ // Clear color buffer to black
+ glClearColor (0.1f, 0.2f, 0.3f, 0.0f);
+ glClear (GL_COLOR_BUFFER_BIT);
+
+ // Select and setup the projection matrix
+ glMatrixMode (GL_PROJECTION);
+ glLoadIdentity ();
+ gluPerspective (65.0f, (GLfloat) width / (GLfloat) height, 1.0f, 100.0f);
+
+ // Select and setup the modelview matrix
+ glMatrixMode (GL_MODELVIEW);
+ glLoadIdentity ();
+ gluLookAt (0.0f, 1.0f, 0.0f, // Eye-position
+ 0.0f, 20.0f, 0.0f, // View-point
+ 0.0f, 0.0f, 1.0f); // Up-vector
+
+ // Draw a rotating colorful triangle
+ //glTranslatef (0.0f, 14.0f, 0.0f);
+ glTranslatef (0.0f, 1.0f, 0.0f);
+ glRotatef (0.3f * (GLfloat) x + (GLfloat) t * 100.0f, 0.0f, 0.0f, 1.0f);
+ glBegin (GL_TRIANGLES);
+ glColor3f (1.0f, 0.0f, 0.0f);
+ glVertex3f (-5.0f, 0.0f, -4.0f);
+ glColor3f (0.0f, 1.0f, 0.0f);
+ glVertex3f (5.0f, 0.0f, -4.0f);
+ glColor3f (0.0f, 0.0f, 1.0f);
+ glVertex3f (0.0f, 0.0f, 6.0f);
+ glEnd ();
+
+ // Swap buffers
+ glfwSwapBuffers ();
+}
+
+void OnCharPressed( int character, int action ){
+ if(action == GLFW_PRESS)
+ printf("'%c' (%i) char is pressed\n", character, character);
+ if(action == GLFW_RELEASE)
+ printf("'%c' (%i) char is released\n", character, character);
+}
+
+char* GetKeyName(int key){
+ switch(key){
+ case GLFW_KEY_UNKNOWN: return "unknown";
+ case GLFW_KEY_SPACE: return "space";
+ case GLFW_KEY_SPECIAL: return "special";
+ case GLFW_KEY_ESC: return "escape";
+ case GLFW_KEY_F1 : return "F1";
+ case GLFW_KEY_F2 : return "F2";
+ case GLFW_KEY_F3 : return "F3";
+ case GLFW_KEY_F4 : return "F4";
+ case GLFW_KEY_F5 : return "F5";
+ case GLFW_KEY_F6 : return "F6";
+ case GLFW_KEY_F7 : return "F7";
+ case GLFW_KEY_F8 : return "F8";
+ case GLFW_KEY_F9 : return "F9";
+ case GLFW_KEY_F10: return "F10";
+ case GLFW_KEY_F11: return "F11";
+ case GLFW_KEY_F12: return "F12";
+ case GLFW_KEY_F13: return "F13";
+ case GLFW_KEY_F14: return "F14";
+ case GLFW_KEY_F15: return "F15";
+ case GLFW_KEY_F16: return "F16";
+ case GLFW_KEY_F17: return "F17";
+ case GLFW_KEY_F18: return "F18";
+ case GLFW_KEY_F19: return "F19";
+ case GLFW_KEY_F20: return "F20";
+ case GLFW_KEY_F21: return "F21";
+ case GLFW_KEY_F22: return "F22";
+ case GLFW_KEY_F23: return "F23";
+ case GLFW_KEY_F24: return "F24";
+ case GLFW_KEY_F25: return "F25";
+ case GLFW_KEY_UP : return "up";
+ case GLFW_KEY_DOWN: return "down";
+ case GLFW_KEY_LEFT: return "left";
+ case GLFW_KEY_RIGHT: return "right";
+ case GLFW_KEY_LSHIFT: return "left shift";
+ case GLFW_KEY_RSHIFT: return "right shift";
+ case GLFW_KEY_LCTRL: return "left ctrl";
+ case GLFW_KEY_RCTRL: return "right ctrl";
+ case GLFW_KEY_LALT: return "left alt";
+ case GLFW_KEY_RALT: return "right alt";
+ case GLFW_KEY_TAB: return "tab";
+ case GLFW_KEY_ENTER: return "enter";
+ case GLFW_KEY_BACKSPACE: return "backspace";
+ case GLFW_KEY_INSERT: return "insertr";
+ case GLFW_KEY_DEL: return "del";
+ case GLFW_KEY_PAGEUP: return "page up";
+ case GLFW_KEY_PAGEDOWN: return "page down";
+ case GLFW_KEY_HOME: return "home";
+ case GLFW_KEY_END: return "end";
+ case GLFW_KEY_KP_0: return "0";
+ case GLFW_KEY_KP_1: return "1";
+ case GLFW_KEY_KP_2: return "2";
+ case GLFW_KEY_KP_3: return "3";
+ case GLFW_KEY_KP_4: return "4";
+ case GLFW_KEY_KP_5: return "5";
+ case GLFW_KEY_KP_6: return "6";
+ case GLFW_KEY_KP_7: return "7";
+ case GLFW_KEY_KP_8: return "8";
+ case GLFW_KEY_KP_9: return "9";
+ case GLFW_KEY_KP_DIVIDE: return "/";
+ case GLFW_KEY_KP_MULTIPLY: return "*";
+ case GLFW_KEY_KP_SUBTRACT: return "-";
+ case GLFW_KEY_KP_ADD: return "+";
+ case GLFW_KEY_KP_DECIMAL: return ".";
+ case GLFW_KEY_KP_EQUAL: return "=";
+ case GLFW_KEY_KP_ENTER: return "enter";
+ case GLFW_KEY_KP_NUM_LOCK: return "num lock";
+ case GLFW_KEY_CAPS_LOCK: return "caps lock";
+ case GLFW_KEY_SCROLL_LOCK: return "scroll lock";
+ case GLFW_KEY_PAUSE: return "pause";
+ case GLFW_KEY_LSUPER: return "left super";
+ case GLFW_KEY_RSUPER: return "right super";
+ case GLFW_KEY_MENU: return "menu";
+ }
+ char* chr = malloc(2*sizeof(char));
+ chr[0] = key;
+ chr[1] = '\0';
+ return chr;
+}
+
+char* GetParamName(int param){
+ switch(param){
+ case GLFW_WINDOW : return "GLFW_WINDOW";
+ case GLFW_FULLSCREEN : return "GLFW_FULLSCREEN";
+ case GLFW_OPENED : return "GLFW_OPENED";
+ case GLFW_ACTIVE : return "GLFW_ACTIVE";
+ case GLFW_ICONIFIED : return "GLFW_ICONIFIED";
+ case GLFW_ACCELERATED : return "GLFW_ACCELERATED";
+ case GLFW_RED_BITS : return "GLFW_RED_BITS";
+ case GLFW_GREEN_BITS : return "GLFW_GREEN_BITS";
+ case GLFW_BLUE_BITS : return "GLFW_BLUE_BITS";
+ case GLFW_ALPHA_BITS : return "GLFW_ALPHA_BITS";
+ case GLFW_DEPTH_BITS : return "GLFW_DEPTH_BITS";
+ case GLFW_STENCIL_BITS : return "GLFW_STENCIL_BITS";
+ case GLFW_REFRESH_RATE : return "GLFW_REFRESH_RATE";
+ case GLFW_ACCUM_RED_BITS : return "GLFW_ACCUM_RED_BITS";
+ case GLFW_ACCUM_GREEN_BITS : return "GLFW_ACCUM_GREEN_BITS";
+ case GLFW_ACCUM_BLUE_BITS : return "GLFW_BLUE_BITS";
+ case GLFW_ACCUM_ALPHA_BITS : return "GLFW_ALPHA_BITS";
+ case GLFW_AUX_BUFFERS : return "GLFW_AUX_BUFFERS";
+ case GLFW_STEREO : return "GLFW_STEREO";
+ case GLFW_WINDOW_NO_RESIZE : return "GLFW_WINDOW_NO_RESIZE";
+ case GLFW_FSAA_SAMPLES : return "GLFW_FSAA_SAMPLES";
+ case GLFW_OPENGL_VERSION_MAJOR : return "GLFW_OPENGL_VERSION_MAJOR";
+ case GLFW_OPENGL_VERSION_MINOR : return "GLFW_OPENGL_VERSION_MINOR";
+ case GLFW_OPENGL_FORWARD_COMPAT : return "GLFW_OPENGL_FORWARD_COMPAT";
+ case GLFW_OPENGL_DEBUG_CONTEXT : return "GLFW_OPENGL_DEBUG_CONTEXT";
+ case GLFW_OPENGL_PROFILE : return "GLFW_OPENGL_PROFILE";
+ case GLFW_OPENGL_CORE_PROFILE : return "GLFW_OPENGL_CORE_PROFILE | GLFW_PRESENT";
+ case GLFW_OPENGL_COMPAT_PROFILE : return "GLFW_OPENGL_COMPAT_PROFILE | GLFW_AXES";
+ case GLFW_MOUSE_CURSOR : return "GLFW_MOUSE_CURSOR";
+ case GLFW_STICKY_KEYS : return "GLFW_STICKY_KEYS";
+ case GLFW_STICKY_MOUSE_BUTTONS : return "GLFW_STICKY_MOUSE_BUTTONS";
+ case GLFW_SYSTEM_KEYS : return "GLFW_SYSTEM_KEYS";
+ case GLFW_KEY_REPEAT : return "GLFW_KEY_REPEAT";
+ case GLFW_AUTO_POLL_EVENTS : return "GLFW_AUTO_POLL_EVENTS";
+ case GLFW_WAIT : return "GLFW_WAIT";
+ case GLFW_NOWAIT : return "GLFW_NOWAIT";
+ case GLFW_BUTTONS : return "GLFW_BUTTONS";
+ case GLFW_NO_RESCALE_BIT : return "GLFW_NO_RESCALE_BIT";
+ case GLFW_ORIGIN_UL_BIT : return "GLFW_ORIGIN_UL_BIT";
+ case GLFW_BUILD_MIPMAPS_BIT : return "GLFW_BUILD_MIPMAPS_BIT";
+ case GLFW_ALPHA_MAP_BIT : return "GLFW_ALPHA_MAP_BIT";
+ default : return "Invalid param";
+ }
+}
+
+void OnKeyPressed( int key, int action ){
+ const char* key_name = GetKeyName(key);
+ if(key_name == 0)
+ return;
+ if(action == GLFW_PRESS)
+ printf("'%s' (%i) key is pressed\n", key_name, key);
+ if(action == GLFW_RELEASE)
+ printf("'%s' (%i) key is released\n", key_name, key);
+ if(action == GLFW_RELEASE && key == GLFW_KEY_ENTER)
+ PullInfo();
+}
+
+int OnClose(){
+ printf("Closed\n");
+ return 0;
+}
+
+void OnRefresh(){
+ printf("Refresh\n");
+}
+
+void OnResize( int width, int height ){
+ printf("Resizing to %i %i\n", width, height);
+}
+
+void OnMouseClick( int button, int action ){
+ if(action == GLFW_PRESS)
+ printf("Mouse button %i has been pressed\n", button);
+ if(action == GLFW_RELEASE)
+ printf("Mouse button %i has been released\n", button);
+}
+
+void OnMouseMove( int x, int y ){
+ int lState = glfwGetMouseButton(GLFW_MOUSE_BUTTON_LEFT);
+
+ if (lState == GLFW_PRESS)
+ printf("Dragged %i to %i %i\n", GLFW_MOUSE_BUTTON_LEFT, x, y);
+ if(lState == GLFW_RELEASE)
+ printf("Moved %i to %i %i\n", GLFW_MOUSE_BUTTON_LEFT, x, y);
+}
+
+void OnMouseWheel( int pos ){
+ printf("Mouse wheel has been moved to %i\n", pos);
+}
+
+void PullInfo(){
+ printf("================================================================================\n");
+
+ int major, minor, rev;
+ glfwGetVersion(&major, &minor, &rev);
+ printf("GLFW version is %i.%i.%i\n", major, minor, rev);
+
+ int width, height;
+ glfwGetWindowSize(&width, &height);
+ printf("Window size is %i %i\n", width, height);
+
+ int status = glfwGetKey(GLFW_KEY_LCTRL);
+ if(status == GLFW_PRESS)
+ printf("Left control is pressed\n");
+ else
+ printf("Left control is released\n");
+
+ status = glfwGetMouseButton(GLFW_MOUSE_BUTTON_1);
+ if(status == GLFW_PRESS)
+ printf("Mouse button 1 is pressed\n");
+ else
+ printf("Mouse button 1 is released\n");
+
+ int x, y;
+ glfwGetMousePos(&x, &y);
+ printf("Mouse position is %i %i\n", x, y);
+
+ int wheel = glfwGetMouseWheel();
+ printf("Mouse wheel pos is %i\n", wheel);
+
+ double time = glfwGetTime();
+ printf("Time is %f\n", time);
+
+ glfwGetGLVersion(&major, &minor, &rev);
+ printf("GL version is %i.%i.%i\n", major, minor, rev);
+
+ int proc = glfwGetNumberOfProcessors();
+ printf("%i processors are available\n", proc);
+
+ unsigned int i;
+ for(i = 0; i<nb_params; i++)
+ printf(" - %-27s : %i\n", GetParamName(params[i]), glfwGetWindowParam(params[i]));
+
+ const char* extension = "MOZ_WEBGL_compressed_texture_s3tc";
+ printf("'%s' extension is %s.\n", extension, glfwExtensionSupported(extension) ? "supported" : "not supported");
+
+ extension = "GL_EXT_framebuffer_object";
+ printf("'%s' extension is %s.\n", extension, glfwExtensionSupported(extension) ? "supported" : "not supported");
+
+ printf("Sleeping 1 sec...\n");
+ glfwSleep(1);
+ printf("...Done.\n");
+
+ printf("================================================================================\n");
+
+#ifdef REPORT_RESULT
+ int result = 1;
+ REPORT_RESULT();
+#endif
+}
diff --git a/tests/runner.py b/tests/runner.py
index ef014a18..23935656 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -1977,7 +1977,6 @@ cat |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie', 'too'
if self.emcc_args == []:
gen = open(self.in_dir('src.cpp.o.js')).read()
assert ('var __str1;' in gen) == named
- assert (gen.count('ALLOC_NONE') < 8) == named
def test_strcmp_uni(self):
src = '''
@@ -11241,6 +11240,12 @@ elif 'browser' in str(sys.argv):
Popen([PYTHON, EMCC, '-O2', os.path.join(self.get_dir(), 'openal_playback.cpp'), '--preload-file', 'audio.wav', '-o', 'page.html']).communicate()
self.run_browser('page.html', '', '/report_result?1')
+ def test_glfw(self):
+ open(os.path.join(self.get_dir(), 'glfw.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'glfw.c')).read()))
+
+ Popen([PYTHON, EMCC, '-O2', os.path.join(self.get_dir(), 'glfw.c'), '-o', 'page.html']).communicate()
+ self.run_browser('page.html', '', '/report_result?1')
+
def test_worker(self):
# Test running in a web worker
output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_worker.cpp'), '-o', 'worker.js'], stdout=PIPE, stderr=PIPE).communicate()
diff --git a/tests/sdl_rotozoom.c b/tests/sdl_rotozoom.c
index cb6295cc..b3970f6c 100644
--- a/tests/sdl_rotozoom.c
+++ b/tests/sdl_rotozoom.c
@@ -7,12 +7,12 @@
#endif
SDL_Surface *screen;
-SDL_Surface *sprite[4];
+SDL_Surface *sprite[6];
void mainloop() {
int i;
SDL_Rect rect = { 0, 0, 100, 100 };
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 6; i++) {
rect.x = i & 1 ? 200 : 0;
rect.y = i & 2 ? 200 : 0;
SDL_BlitSurface(sprite[i], 0, screen, &rect);
@@ -30,6 +30,8 @@ int main(int argc, char **argv) {
SDL_FillRect(sprite[1], 0, 0xA0A0A0A0);
sprite[2] = zoomSurface(sprite[0], 0.5, 0.5, SMOOTHING_ON);
sprite[3] = zoomSurface(sprite[1], 0.5, 0.5, SMOOTHING_ON);
+ sprite[4] = rotozoomSurface(sprite[0], -20, 0.3, SMOOTHING_ON);
+ sprite[5] = rotozoomSurface(sprite[1], 45, 0.5, SMOOTHING_ON);
mainloop();
diff --git a/tests/sdl_rotozoom.png b/tests/sdl_rotozoom.png
index 83ec0589..3ca8da70 100644
--- a/tests/sdl_rotozoom.png
+++ b/tests/sdl_rotozoom.png
Binary files differ
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py
index 1f1c1354..4d37408c 100644
--- a/tools/js_optimizer.py
+++ b/tools/js_optimizer.py
@@ -34,7 +34,7 @@ class Minifier:
# Create list of valid short names
- MAX_NAMES = 60000
+ MAX_NAMES = 80000
INVALID_2 = set(['do', 'if', 'in'])
INVALID_3 = set(['for', 'new', 'try', 'var', 'env'])
diff --git a/tools/shared.py b/tools/shared.py
index 4501faa9..a13c20a6 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -7,6 +7,9 @@ def listify(x):
if type(x) is not list: return [x]
return x
+# Temp file utilities
+from tempfiles import try_delete
+
# On Windows python suffers from a particularly nasty bug if python is spawning new processes while python itself is spawned from some other non-console process.
# Use a custom replacement for Popen on Windows to avoid the "WindowsError: [Error 6] The handle is invalid" errors when emcc is driven through cmake or mingw32-make.
# See http://bugs.python.org/issue3905
@@ -181,7 +184,7 @@ def check_node_version():
# we re-check sanity when the settings are changed)
# We also re-check sanity and clear the cache when the version changes
-EMSCRIPTEN_VERSION = '1.3.5'
+EMSCRIPTEN_VERSION = '1.3.6'
def check_sanity(force=False):
try:
@@ -383,10 +386,11 @@ except:
# Force a simple, standard target as much as possible: target 32-bit linux, and disable various flags that hint at other platforms
# -fno-ms-compatibility is passed, since on Windows, Clang enables a 'MS compatibility mode' by default, that disables char16_t and char32_t
# to be MSVC header -compatible. This would cause build errors in libcxx file __config.
+# -fno-delayed-template-parsing is needed on Windows due to http://llvm.org/PR15651
COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__x86_64__', '-U__i386', '-U__x86_64', '-Ui386', '-Ux86_64', '-U__SSE__', '-U__SSE2__', '-U__MMX__',
'-UX87_DOUBLE_ROUNDING', '-UHAVE_GCC_ASM_FOR_X87', '-DEMSCRIPTEN', '-U__STRICT_ANSI__', '-U__CYGWIN__',
'-D__STDC__', '-Xclang', '-triple=i386-pc-linux-gnu', '-D__IEEE_LITTLE_ENDIAN', '-fno-math-errno',
- '-fno-ms-compatibility']
+ '-fno-ms-compatibility', '-fno-delayed-template-parsing']
USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK')
@@ -435,9 +439,6 @@ if not WINDOWS:
except:
pass
-# Temp file utilities
-from tempfiles import try_delete
-
# Utilities
def check_engine(engine):