Merge branch 'webidl-void-pointers' of https://github.com/artillery/emscripten into incoming
Conflicts: tests/webidl/output.txt tests/webidl/post.js
This commit is contained in:
Коммит
10172fce55
|
@ -67,5 +67,6 @@ return unsigned short -1
|
|||
unsigned short int: 65535
|
||||
return unsigned long -1
|
||||
unsigned long int: 4294967295
|
||||
void * 3
|
||||
|
||||
done.
|
||||
|
|
|
@ -143,6 +143,10 @@ typeTester.AcceptUnsignedShortMethod((2<<15)-1);
|
|||
// Prints -1 because all integers are signed in javascript.
|
||||
Module.print('return unsigned long ' + typeTester.ReturnUnsignedLongMethod());
|
||||
typeTester.AcceptUnsignedLongMethod((2<<31)-1);
|
||||
var voidPointerUser = new Module.VoidPointerUser();
|
||||
|
||||
voidPointerUser.SetVoidPointer(3);
|
||||
Module.print('void * ' + voidPointerUser.GetVoidPointer());
|
||||
|
||||
//
|
||||
|
||||
|
|
|
@ -65,6 +65,13 @@ struct RefUser {
|
|||
StringUser getAnother() { return StringUser("another", 5); }
|
||||
};
|
||||
|
||||
struct VoidPointerUser {
|
||||
void *ptr;
|
||||
|
||||
void *GetVoidPointer() { return ptr; }
|
||||
void SetVoidPointer(void *p) { ptr = p; }
|
||||
};
|
||||
|
||||
namespace Space {
|
||||
struct Inner {
|
||||
Inner() {}
|
||||
|
|
|
@ -58,6 +58,13 @@ interface RefUser {
|
|||
[Value] StringUser getAnother();
|
||||
};
|
||||
|
||||
interface VoidPointerUser {
|
||||
void VoidPointerUser();
|
||||
|
||||
any GetVoidPointer();
|
||||
void SetVoidPointer(any ptr);
|
||||
};
|
||||
|
||||
[Prefix="Space::"]
|
||||
interface Inner {
|
||||
void Inner();
|
||||
|
|
|
@ -159,6 +159,8 @@ def type_to_c(t, non_pointing=False):
|
|||
return 'double'
|
||||
elif t == 'Boolean':
|
||||
return 'bool'
|
||||
elif t == 'Any':
|
||||
return 'void*'
|
||||
elif t in interfaces:
|
||||
return (interfaces[t].getExtendedAttribute('Prefix') or [''])[0] + t + ('' if non_pointing else '*')
|
||||
else:
|
||||
|
|
Загрузка…
Ссылка в новой задаче