Skip to content

Commit 7ed3de1

Browse files
Experimental WebAssembly Support Using emscripten
1 parent 0099c59 commit 7ed3de1

File tree

6 files changed

+83
-1
lines changed

6 files changed

+83
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ ipch/
4646
*.VC.db*
4747
*.tds
4848
*.*codeanalysis*
49+
*.js
50+
*.wasm

ACE/ace/Notification_Queue.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "ace/Intrusive_List.h"
1414
#include "ace/Intrusive_List_Node.h"
1515
#include "ace/Unbounded_Queue.h"
16+
#include "ace/Synch_Traits.h"
17+
#include "ace/Thread_Mutex.h"
1618

1719
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
1820

ACE/ace/Timer_Queue_T.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// -*- C++ -*-
22
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
33

4+
#include "ace/Guard_T.h"
5+
6+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
7+
48
template <class TYPE, class FUNCTOR> ACE_INLINE FUNCTOR &
59
ACE_Timer_Queue_Upcall_Base<TYPE, FUNCTOR>::upcall_functor ()
610
{

ACE/ace/config-emscripten.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef ACE_CONFIG_EMSCRIPTEN_H
2+
#define ACE_CONFIG_EMSCRIPTEN_H
3+
4+
#define ACE_EMSCRIPTEN
5+
6+
#define ACE_HAS_CPP11
7+
8+
// Threading
9+
#define ACE_MT_SAFE 1
10+
#define ACE_HAS_THREADS 1
11+
#define ACE_HAS_PTHREADS
12+
#define ACE_HAS_PTHREADS_UNIX98_EXT
13+
#define ACE_HAS_THREAD_SPECIFIC_STORAGE
14+
15+
// Basic Types
16+
#define ACE_HAS_SSIZE_T
17+
#define ACE_HAS_WCHAR
18+
19+
// Time
20+
#define ACE_HAS_POSIX_TIME
21+
#define ACE_LACKS_TIMESPEC_T
22+
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
23+
#define ACE_HAS_VOIDPTR_GETTIMEOFDAY
24+
25+
// Everything else
26+
#define ACE_HAS_UCONTEXT_T
27+
#define ACE_HAS_MSG
28+
#define ACE_HAS_CPU_SET_T
29+
#define ACE_LACKS_ISCTYPE
30+
#define ACE_HAS_STRBUF_T
31+
#define ACE_HAS_SOCKLEN_T
32+
#define ACE_LACKS_AUTO_PTR
33+
#define ACE_HAS_SIGINFO_T
34+
#define ACE_LACKS_SIGINFO_H
35+
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
36+
#define ACE_HAS_3_PARAM_WCSTOK
37+
#define ACE_LACKS_ITOW
38+
#define ACE_LACKS_WCSICMP
39+
#define ACE_LACKS_WCSNICMP
40+
#define ACE_HAS_DIRENT
41+
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
42+
43+
#include "config-posix.h"
44+
#include "config-g++-common.h"
45+
46+
// Not supported? https://github.com/emscripten-core/emscripten/issues/18050
47+
#ifdef ACE_HAS_AIO_CALLS
48+
# undef ACE_HAS_AIO_CALLS
49+
#endif
50+
51+
#endif

ACE/ace/os_include/sys/os_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef double ACE_timer_t;
6666
#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG == 8
6767
typedef off_t ACE_LOFF_T;
6868
#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || \
69-
(defined (ACE_OPENVMS) && defined (_LARGEFILE))
69+
(defined (ACE_OPENVMS) && defined (_LARGEFILE)) || defined (ACE_EMSCRIPTEN)
7070
typedef off_t ACE_LOFF_T;
7171
#elif defined (AIX) || defined (HPUX) || defined (__QNX__)
7272
typedef off64_t ACE_LOFF_T;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ACE_PLATFORM_CONFIG ?= config-emscripten.h
2+
EXEEXT = .js
3+
4+
debug ?= 1
5+
optimize ?= 1
6+
threads ?= 1
7+
inline ?= 1
8+
static_libs_only = 1
9+
10+
CROSS_COMPILE := THIS_VALUE_SHOULD_NOT_BE_USED
11+
override_cross_compile = 1
12+
CC = emcc
13+
CXX = em++
14+
AR = emar
15+
LD = emcc
16+
17+
ifeq ($(threads),1)
18+
FLAGS_C_CC += -pthread
19+
SOFLAGS += -pthread
20+
LIBS += -lrt
21+
endif
22+
23+
include $(ACE_ROOT)/include/makeinclude/platform_clang_common.GNU

0 commit comments

Comments
 (0)