Index: mojo/public/cpp/system/main.h |
diff --git a/mojo/public/cpp/system/main.h b/mojo/public/cpp/system/main.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8f8d95f24b1083c4139bc1a95d436635e5db5d0d |
--- /dev/null |
+++ b/mojo/public/cpp/system/main.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MOJO_PUBLIC_CPP_SYSTEM_MAIN_H_ |
+#define MOJO_PUBLIC_CPP_SYSTEM_MAIN_H_ |
+ |
+#include "mojo/public/cpp/system/core.h" |
+ |
+#if defined(WIN32) |
viettrungluu
2014/08/19 22:30:57
I think I'd write this as
#if defined(WIN32)
exte
tim (not reviewing)
2014/08/20 18:02:06
Thanks for the explanation. I removed the extra ex
|
+#if !defined(CDECL) |
+#define CDECL __cdecl |
+#endif |
+#define MOJO_MAIN_EXPORT __declspec(dllexport) |
+#else |
+#define CDECL |
+#define MOJO_MAIN_EXPORT __attribute__((visibility("default"))) |
+#endif |
+ |
+// DSOs should implement MojoMain directly. Note that the fancy decorations |
viettrungluu
2014/08/19 22:30:57
You shouldn't mention "DSOs", since the fact that
tim (not reviewing)
2014/08/20 18:02:06
Noted. Done.
|
+// are not required in the definition, so you should write |
+// |
+// MojoResult MojoMain(MojoHandle shell_handle) { |
+// ... |
+// } |
+// |
+// See public/cpp/application/application_runner* for recommended way of |
viettrungluu
2014/08/19 22:30:57
I think you can omit this comment. cpp/system does
tim (not reviewing)
2014/08/20 18:02:06
OK, done.
|
+// launching an ApplicationImpl. |
+// TODO(davemoore): Establish this as part of our SDK for third party mojo |
+// application writers. |
+extern "C" MOJO_MAIN_EXPORT MojoResult CDECL MojoMain( |
+ MojoHandle service_provider_handle); |
+ |
+#endif // MOJO_PUBLIC_CPP_SYSTEM_MAIN_H_ |