Browse Source

[php] fixed extern for fseek

Aleksandr Kuzmenko 5 years ago
parent
commit
de803f95e8
3 changed files with 3 additions and 3 deletions
  1. 1 1
      std/php/Global.hx
  2. 1 1
      std/php/_std/sys/io/FileInput.hx
  3. 1 1
      std/php/_std/sys/io/FileOutput.hx

+ 1 - 1
std/php/Global.hx

@@ -638,7 +638,7 @@ extern class Global {
 	/**
 	/**
 		@see http://php.net/manual/en/function.fseek.php
 		@see http://php.net/manual/en/function.fseek.php
 	**/
 	**/
-	static function fseek(handle:Resource, offset:Int, ?whence:Int):EitherType<Int, Bool>;
+	static function fseek(handle:Resource, offset:Int, ?whence:Int):Int;
 
 
 	/**
 	/**
 		@see http://php.net/manual/en/function.ftell.php
 		@see http://php.net/manual/en/function.ftell.php

+ 1 - 1
std/php/_std/sys/io/FileInput.hx

@@ -76,7 +76,7 @@ class FileInput extends haxe.io.Input {
 				w = SEEK_END;
 				w = SEEK_END;
 		}
 		}
 		var r = fseek(__f, p, w);
 		var r = fseek(__f, p, w);
-		if (r == false)
+		if (r == -1)
 			throw Custom('An error occurred');
 			throw Custom('An error occurred');
 	}
 	}
 
 

+ 1 - 1
std/php/_std/sys/io/FileOutput.hx

@@ -73,7 +73,7 @@ class FileOutput extends haxe.io.Output {
 				w = SEEK_END;
 				w = SEEK_END;
 		}
 		}
 		var r = fseek(__f, p, w);
 		var r = fseek(__f, p, w);
-		if (r == false)
+		if (r == -1)
 			throw haxe.io.Error.Custom('An error occurred');
 			throw haxe.io.Error.Custom('An error occurred');
 	}
 	}