loader: build_module_importation invalidates the mmodule on errors
[nit.git] / lib / pnacl.nit
index b997c3f..516c860 100644 (file)
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#
-# Targets the PNaCl platform
+
+# Provides PNaCl support for Nit.
 #
 # To use this module and compile for PNaCl, you must install the
 # NaCl SDK (This file is based on Pepper 33).
 # If NACL_SDK_ROOT is not set in your PATH, you have to work in
 # 'nacl_sdk/pepper_your_pepper_version/getting_started/your_project_folder'.
-#
-# Provides PNaCl support for Nit.
 module pnacl is platform
 
+import standard
+intrude import standard::stream
+
 in "C Header" `{
        #include "ppapi/c/pp_errors.h"
        #include "ppapi/c/ppp.h"
@@ -43,6 +44,7 @@ in "C Header" `{
        #include <string.h>
        #include <stdlib.h>
        #include <pthread.h>
+       #include <poll.h>
 
        #define MAX_DICTIONARY_QUEUE_SIZE 200
        #define MAX_MESSAGE_QUEUE_SIZE 10
@@ -357,7 +359,7 @@ in "C Header" `{
        }
 
        /* Hack in order to avoid the problem with file. */
-       int poll(void *fds, int nfds, int timeout) { return 0; }
+       int poll(struct pollfd* fds, nfds_t nfds, int timeout) { return 0; }
 `}
 
 # Nit class representing a Pepper C API PP_Var typed as a Dictionary.
@@ -628,9 +630,9 @@ end
 
 # A stream for PNaCl, redefines basic input and output methods.
 class PnaclStream
-       super PollableIStream
-       super OStream
-       super BufferedIStream
+       super PollableReader
+       super Writer
+       super BufferedReader
 
        init do prepare_buffer(10)