THRIFT-5589 Haxe compiler/runtime fixes
Client: hx
Patch: Jens Geyer
diff --git a/.gitignore b/.gitignore
index 7b068e4..6278185 100644
--- a/.gitignore
+++ b/.gitignore
@@ -202,6 +202,8 @@
 /lib/delphi/*.identcache
 /lib/delphi/test/skip/bin
 /lib/delphi/test/serializer/*.dat
+/lib/delphi/test/serializer/bin
+/lib/delphi/test/thrift-testing
 /lib/delphi/**/*.identcache
 /lib/delphi/**/*.local
 /lib/delphi/**/*.dcu
diff --git a/compiler/cpp/src/thrift/generate/t_haxe_generator.cc b/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
index 111e0f6..42b4181 100644
--- a/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
@@ -94,8 +94,7 @@
                          t_const_value* value,
                          bool in_static,
                          bool defval = false);
-  std::string render_const_value(ostream& out,
-                                 std::string name,
+  std::string render_const_value(std::string name,
                                  t_type* type,
                                  t_const_value* value);
 
@@ -502,7 +501,7 @@
     out << (in_static ? "var " : "public static inline var  ");
   }
   if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
+    string v2 = render_const_value(name, type, value);
     out << name;
     if (!defval) {
       out << ":" << type_name(type);
@@ -537,7 +536,7 @@
       if (field_type == nullptr) {
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
-      string val = render_const_value(out, name, field_type, v_iter->second);
+      string val = render_const_value(name, field_type, v_iter->second);
       indent(out) << name << ".";
       out << v_iter->first->get_string() << " = " << val << ";" << endl;
     }
@@ -565,8 +564,8 @@
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
+      string key = render_const_value(name, ktype, v_iter->first);
+      string val = render_const_value(name, vtype, v_iter->second);
       indent(out) << name << "[" << key << "] = " << val << ";" << endl;
     }
     if (!in_static) {
@@ -597,7 +596,7 @@
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
+      string val = render_const_value(name, etype, *v_iter);
       indent(out) << name << "." << (type->is_list() ? "push" : "add") << "(" << val << ");"
                   << endl;
     }
@@ -613,8 +612,7 @@
   }
 }
 
-string t_haxe_generator::render_const_value(ostream& out,
-                                            string name,
+string t_haxe_generator::render_const_value(string name,
                                             t_type* type,
                                             t_const_value* value) {
   (void)name;
@@ -655,9 +653,12 @@
   } else if (type->is_enum()) {
     render << value->get_integer();
   } else {
-    string t = tmp("tmp");
+    /* this is badly broken
+	string t = tmp("tmp");
     print_const_value(out, t, type, value, true);
     render << t;
+	*/
+	render << "null";  // we fix that later
   }
 
   return render.str();
@@ -801,8 +802,9 @@
   }
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     if ((*m_iter)->get_value() != nullptr) {
-      indent(out) << "this." << (*m_iter)->get_name() << " = "
-                  << (*m_iter)->get_value()->get_integer() << ";" << endl;
+      indent(out) << "this." << (*m_iter)->get_name() << " = ";
+      out << render_const_value((*m_iter)->get_name(), (*m_iter)->get_type(), (*m_iter)->get_value());
+      out << ";" << endl;
     }
   }
   indent_down();
@@ -2653,8 +2655,7 @@
   if (init) {
     t_type* ttype = get_true_type(tfield->get_type());
     if (ttype->is_base_type() && tfield->get_value() != nullptr) {
-      std::ofstream dummy;
-      result += " = " + render_const_value(dummy, tfield->get_name(), ttype, tfield->get_value());
+      result += " = " + render_const_value(tfield->get_name(), ttype, tfield->get_value());
     } else if (ttype->is_base_type()) {
       t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
       switch (tbase) {
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/FieldMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/FieldMetaData.hx
deleted file mode 100644
index 26db113..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/FieldMetaData.hx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-import flash.utils.Dictionary;
-
-/**
-* This class is used to store meta data about thrift fields. Every field in a
-* a struct should have a corresponding instance of this class describing it.
-*
-*/
-class FieldMetaData {
-
-  public var fieldName : String;
-  public var requirementType : Int;
-  public var valueMetaData:FieldValueMetaData;
-
-  private static var structMap:Dictionary = new Dictionary();
-
-  public function FieldMetaData(name : String, req : Int, vMetaData:FieldValueMetaData) {
-    this.fieldName = name;
-    this.requirementType = req;
-    this.valueMetaData = vMetaData;
-  }
-
-  public static function addStructMetaDataMap(sClass:Class, map:Dictionary) : Void{
-    structMap[sClass] = map;
-  }
-
-  /**
-   * Returns a map with metadata (i.e. instances of FieldMetaData) that
-   * describe the fields of the given class.
-   *
-   * @param sClass The TBase class for which the metadata map is requested
-   */
-  public static function getStructMetaDataMap(sClass:Class):Dictionary {
-    return structMap[sClass];
-  }
-}
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/FieldValueMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/FieldValueMetaData.hx
deleted file mode 100644
index 8879d91..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/FieldValueMetaData.hx
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-import org.apache.thrift.protocol.TType;
-
-/**
- * FieldValueMetaData and collection of subclasses to store metadata about
- * the value(s) of a field
- */
-class FieldValueMetaData {
-
-  public var type : Int;
-
-  public function FieldValueMetaData(type : Int) {
-    this.type = type;
-  }
-
-  public function isStruct() : Bool {
-    return type == TType.STRUCT;
-  }
-
-  public function isContainer() : Bool {
-    return type == TType.LIST || type == TType.MAP || type == TType.SET;
-  }
-}
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/ListMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/ListMetaData.hx
deleted file mode 100644
index 40ca31b..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/ListMetaData.hx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-class ListMetaData extends FieldValueMetaData {
-
-    public var elemMetaData:FieldValueMetaData;
-
-    public function ListMetaData(type : Int, eMetaData:FieldValueMetaData) {
-      super(type);
-      this.elemMetaData = eMetaData;
-    }
-}
- 
\ No newline at end of file
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/MapMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/MapMetaData.hx
deleted file mode 100644
index 5463e62..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/MapMetaData.hx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-class MapMetaData extends FieldValueMetaData {
-
-    public var keyMetaData:FieldValueMetaData;
-    public var valueMetaData:FieldValueMetaData;
-
-    public function MapMetaData(type : Int, kMetaData:FieldValueMetaData, vMetaData:FieldValueMetaData) {
-      super(type);
-      this.keyMetaData = kMetaData;
-      this.valueMetaData = vMetaData;
-    }
-}
-   
\ No newline at end of file
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/SetMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/SetMetaData.hx
deleted file mode 100644
index a3367f4..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/SetMetaData.hx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-class SetMetaData extends FieldValueMetaData {
-
-    public var elemMetaData:FieldValueMetaData;
-
-    public function SetMetaData(type : Int, eMetaData:FieldValueMetaData) {
-      super(type);
-      this.elemMetaData = eMetaData;
-    }
-}
diff --git a/lib/haxe/src/org/apache/thrift/meta_data/StructMetaData.hx b/lib/haxe/src/org/apache/thrift/meta_data/StructMetaData.hx
deleted file mode 100644
index 1822dd3..0000000
--- a/lib/haxe/src/org/apache/thrift/meta_data/StructMetaData.hx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, 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.
- */
-
-package org.apache.thrift.meta_data;
-
-class StructMetaData extends FieldValueMetaData {
-
-    public var structClass:Class;
-
-    public function StructMetaData(type : Int, sClass:Class) {
-      super(type);
-      this.structClass = sClass;
-    }
-}
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TProtocolDecorator.hx b/lib/haxe/src/org/apache/thrift/protocol/TProtocolDecorator.hx
index 011f42b..08598e6 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TProtocolDecorator.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TProtocolDecorator.hx
@@ -135,6 +135,10 @@
         wrapped.writeBinary( value);
     }
 
+    public function writeUuid(value : String ) : Void {
+        wrapped.writeUuid( value);
+    }
+
     public function readMessageBegin() : TMessage {
         return wrapped.readMessageBegin();
     }
@@ -216,6 +220,10 @@
         return wrapped.readBinary();
     }
 
+    public function readUuid() : String {
+        return wrapped.readUuid();
+    }
+
     public function IncrementRecursionDepth() : Void {
         return wrapped.IncrementRecursionDepth();
     }
diff --git a/lib/haxe/src/org/apache/thrift/transport/TFileStream.hx b/lib/haxe/src/org/apache/thrift/transport/TFileStream.hx
index cd8ad17..0130cd2 100644
--- a/lib/haxe/src/org/apache/thrift/transport/TFileStream.hx
+++ b/lib/haxe/src/org/apache/thrift/transport/TFileStream.hx
@@ -18,6 +18,7 @@
  */
 
 package org.apache.thrift.transport;
+#if sys
 
 import haxe.io.Bytes;
 import haxe.io.BytesBuffer;
@@ -98,4 +99,5 @@
     }
 
 }
- 
\ No newline at end of file
+ 
+#end
diff --git a/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx b/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
index cc34ec4..fe07be9 100644
--- a/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
+++ b/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
@@ -18,6 +18,7 @@
  */
 
 package org.apache.thrift.transport;
+#if swf
 
 import flash.errors.EOFError;
 import flash.events.Event;
@@ -35,13 +36,13 @@
 import flash.events.EventDispatcher;
 
 
-    /**
-     * HTTP implementation of the TTransport interface. Used for working with a
-     * Thrift web services implementation.
-     * Unlike Http Client, it uses a single POST, and chunk-encoding to transfer all messages.
-     */
+/**
+ * HTTP implementation of the TTransport interface. Used for working with a
+ * Thrift web services implementation.
+ * Unlike Http Client, it uses a single POST, and chunk-encoding to transfer all messages.
+ */
 
-public class TFullDuplexHttpClient extends TEndpointTransport
+class TFullDuplexHttpClient extends TEndpointTransport
 {
 	private var socket : Socket = null;
 	private var host  :  String;
@@ -163,9 +164,9 @@
 	{
 		var debug  :  String = "BUFFER >>";
 		var i  :  Int;
-		for (i = 0; i < buf.length; i++)
+		for (i in 0 ... buf.length)
 		{
-			debug += buf[i] as int;
+			debug += buf.get(i);
 			debug += " ";
 		}
 
@@ -254,4 +255,6 @@
 		return (this.socket != null) && this.socket.connected;
 	}
 
-}
\ No newline at end of file
+}
+
+#end
diff --git a/lib/haxe/src/org/apache/thrift/transport/TSocket.hx b/lib/haxe/src/org/apache/thrift/transport/TSocket.hx
index a743543..2e154c3 100644
--- a/lib/haxe/src/org/apache/thrift/transport/TSocket.hx
+++ b/lib/haxe/src/org/apache/thrift/transport/TSocket.hx
@@ -213,7 +213,7 @@
         #elseif js
 
         var data = obuffer.getBytes();
-        var outbuf = new js.html.Int8Array(data.length);
+        var outbuf = new js.lib.Int8Array(data.length);
         var len = 0;
         while( len < data.length) {
             outbuf.set( [data.get(len)], len);
diff --git a/lib/haxe/test/HaxeTests.hxproj b/lib/haxe/test/HaxeTests.hxproj
index 3beed82..7ad2392 100644
--- a/lib/haxe/test/HaxeTests.hxproj
+++ b/lib/haxe/test/HaxeTests.hxproj
@@ -4,11 +4,11 @@
   <output>
     <movie outputType="Application" />
     <movie input="" />
-    <movie path="bin/HaxeTests" />
+    <movie path="bin\HaxeTests" />
     <movie fps="30" />
     <movie width="800" />
     <movie height="600" />
-    <movie version="1" />
+    <movie version="0" />
     <movie minorVersion="0" />
     <movie platform="C++" />
     <movie background="#FFFFFF" />
@@ -17,7 +17,7 @@
   <classpaths>
     <class path="src" />
     <class path="gen-haxe" />
-    <class path="../src" />
+    <class path="..\src" />
   </classpaths>
   <!-- Build options -->
   <build>
@@ -26,11 +26,11 @@
     <option noInlineOnDebug="False" />
     <option mainClass="Main" />
     <option enabledebug="False" />
-    <option additional="" />
+    <option additional="--macro include('org.apache.thrift', true)&#xA;--macro include('thrift', true)" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>
-    <!-- example: <library name="..." /> -->
+    <library name="uuid" />
   </haxelib>
   <!-- Class files to compile (other referenced classes will automatically be included) -->
   <compileTargets>
diff --git a/lib/haxe/test/php.hxml b/lib/haxe/test/php.hxml
index 14f2b2d..9fc23b6 100644
--- a/lib/haxe/test/php.hxml
+++ b/lib/haxe/test/php.hxml
@@ -27,7 +27,7 @@
 
 #PHP target
 -php bin/php/
---php-front Main-debug.php
+#--php-front Main-debug.php
 
 #Add debug information
 -debug
diff --git a/lib/haxe/test/src/MultiplexTest.hx b/lib/haxe/test/src/MultiplexTest.hx
index 3818b66..3e2786d 100644
--- a/lib/haxe/test/src/MultiplexTest.hx
+++ b/lib/haxe/test/src/MultiplexTest.hx
@@ -43,12 +43,12 @@
 import Error;
 
 
-class BenchmarkServiceHandler implements BenchmarkService
+class BenchmarkServiceHandler implements BenchmarkService_service
 {
     public function new() {
     }
 
-    public function fibonacci(n : haxe.Int32) : haxe.Int32 {
+	public function fibonacci(n : haxe.Int32) : haxe.Int32 {
         trace('Benchmark.fibonacci($n)');
         var next : Int;
         var prev   = 0;
@@ -60,12 +60,12 @@
             result = next;
             --n;
         }
-        return result;
+		return result;
     }
 }
 
 
-class AggrServiceHandler implements Aggr
+class AggrServiceHandler implements Aggr_service
 {
     private var values : List<haxe.Int32> = new List<haxe.Int32>();
 
@@ -91,7 +91,7 @@
     private inline static var NAME_AGGR             : String  = "Aggr";
 
 
-    public static override function Run(server : Bool) : Void {
+    public static function Run(server : Bool) : Void {
         if ( server) {
             RunMultiplexServer();
         } else {
@@ -102,13 +102,13 @@
 
 
     // run the multiplex server
-    public static override function RunMultiplexServer() : Void  {
+    public static function RunMultiplexServer() : Void  {
        try
        {
-            var benchHandler : BenchmarkService = new BenchmarkServiceHandler();
+            var benchHandler : BenchmarkService_service = new BenchmarkServiceHandler();
             var benchProcessor : TProcessor = new BenchmarkServiceProcessor( benchHandler);
 
-            var aggrHandler : Aggr = new AggrServiceHandler();
+            var aggrHandler : Aggr_service = new AggrServiceHandler();
             var aggrProcessor : TProcessor = new AggrProcessor( aggrHandler);
 
             var multiplex : TMultiplexedProcessor = new TMultiplexedProcessor();
@@ -137,7 +137,7 @@
 
 
     // run multiplex client against multiplex server
-    public static override function RunMultiplexClient() : Void  {
+    public static function RunMultiplexClient() : Void  {
         try
         {
             var trans : TTransport;
@@ -187,7 +187,7 @@
 
 
     // run non-multiplex client against multiplex server to test default fallback
-    public static override function RunDefaultClient() : Void  {
+    public static function RunDefaultClient() : Void  {
         try
         {
             var trans : TTransport;
diff --git a/lib/haxe/test/src/StreamTest.hx b/lib/haxe/test/src/StreamTest.hx
index 244f1ea..9b8706a 100644
--- a/lib/haxe/test/src/StreamTest.hx
+++ b/lib/haxe/test/src/StreamTest.hx
@@ -48,8 +48,9 @@
 
     public static function WriteData() : Xtruct
     {
+		var config : TConfiguration = new TConfiguration();
         var stream : TStream = new TFileStream( tmpfile, CreateNew);
-        var trans : TTransport = new TStreamTransport( null, stream);
+        var trans : TTransport = new TStreamTransport( null, stream, config);
         var prot = new TJSONProtocol( trans);
 
         var data = MakeTestData();
@@ -61,8 +62,9 @@
 
     public static function ReadData() : Xtruct
     {
+		var config : TConfiguration = new TConfiguration();
         var stream : TStream = new TFileStream( tmpfile, Read);
-        var trans : TTransport = new TStreamTransport( stream, null);
+        var trans : TTransport = new TStreamTransport( stream, null, config);
         var prot = new TJSONProtocol( trans);
 
         var data : Xtruct = new Xtruct();
@@ -72,7 +74,7 @@
         return data;
     }
 
-    public static override function Run(server : Bool) : Void
+    public static function Run(server : Bool) : Void
     {
         try {
             var written = WriteData();
diff --git a/test/haxe/TestClientServer.hxproj b/test/haxe/TestClientServer.hxproj
index 44faa37..30fecf3 100644
--- a/test/haxe/TestClientServer.hxproj
+++ b/test/haxe/TestClientServer.hxproj
@@ -26,7 +26,7 @@
     <option noInlineOnDebug="False" />
     <option mainClass="Main" />
     <option enabledebug="False" />
-    <option additional="" />
+    <option additional="--macro include('org.apache.thrift', true)&#xA;--macro include('thrift', true)" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>
diff --git a/test/haxe/php-web-server.hxml b/test/haxe/php-web-server.hxml
index f628c3a..102ae97 100644
--- a/test/haxe/php-web-server.hxml
+++ b/test/haxe/php-web-server.hxml
@@ -32,6 +32,8 @@
 #defines
 -D phpwebserver
 
+# libs
+-lib uuid
 
 #Add debug information
 -debug
diff --git a/test/haxe/php.hxml b/test/haxe/php.hxml
index c3aa97f..4edb86c 100644
--- a/test/haxe/php.hxml
+++ b/test/haxe/php.hxml
@@ -29,6 +29,8 @@
 -php bin/php
 -D php-front=Main-debug.php
 
+# libs
+-lib uuid
 
 #Add debug information
 -debug
diff --git a/tutorial/haxe/Tutorial.hxproj b/tutorial/haxe/Tutorial.hxproj
index 44e0efd..6c656b6 100644
--- a/tutorial/haxe/Tutorial.hxproj
+++ b/tutorial/haxe/Tutorial.hxproj
@@ -8,9 +8,9 @@
     <movie fps="30" />
     <movie width="800" />
     <movie height="600" />
-    <movie version="1" />
+    <movie version="0" />
     <movie minorVersion="0" />
-    <movie platform="C++" />
+    <movie platform="C#" />
     <movie background="#FFFFFF" />
   </output>
   <!-- Other classes to be compiled into your SWF -->
@@ -30,7 +30,7 @@
   </build>
   <!-- haxelib libraries -->
   <haxelib>
-    <!-- example: <library name="..." /> -->
+    <library name="uuid" />
   </haxelib>
   <!-- Class files to compile (other referenced classes will automatically be included) -->
   <compileTargets>
diff --git a/tutorial/haxe/php-web-server.hxml b/tutorial/haxe/php-web-server.hxml
index 88007c1..c6e9432 100644
--- a/tutorial/haxe/php-web-server.hxml
+++ b/tutorial/haxe/php-web-server.hxml
@@ -32,6 +32,8 @@
 #defines
 -D phpwebserver
 
+# libs
+-lib uuid
 
 #Add debug information
 -debug