Skip to content

Commit

Permalink
Merge pull request #107 from fukusuket/fix-nim-200-compile-error
Browse files Browse the repository at this point in the history
Fix Nim 2.0.0 compile error caused by `_` variables
  • Loading branch information
treeform authored Aug 25, 2023
2 parents 3f76aa3 + cbd448a commit 01abb06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/puppy/platforms/macos/macdefs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ const

objc:
proc code*(self: NSError): int
proc dataWithBytes*(class: typedesc[NSData], _: pointer, length: int): NSData
proc dataWithBytes*(class: typedesc[NSData], x: pointer, length: int): NSData
proc bytes*(self: NSData): pointer
proc length*(self: NSData): int
proc keyEnumerator*(self: NSDictionary): NSEnumerator
proc objectForKey*(self: NSDictionary, _: ID): ID
proc objectForKey*(self: NSDictionary, x: ID): ID
proc nextObject*(self: NSEnumerator): ID
proc URLWithString*(class: typedesc[NSURL], _: NSString): NSURL
proc URLWithString*(class: typedesc[NSURL], x: NSString): NSURL
proc requestWithURL*(
class: typedesc[NSMutableURLRequest],
_: NSURL,
x: NSURL,
cachePolicy: NSURLRequestCachePolicy,
timeoutInterval: NSTimeInterval
): NSMutableURLRequest
proc setHTTPMethod*(self: NSMutableURLRequest, _: NSString)
proc setValue*(self: NSMutableURLRequest, _: NSString, forHTTPHeaderField: NSString)
proc setHTTPBody*(self: NSMutableURLRequest, _: NSData)
proc setHTTPMethod*(self: NSMutableURLRequest, x: NSString)
proc setValue*(self: NSMutableURLRequest, x: NSString, forHTTPHeaderField: NSString)
proc setHTTPBody*(self: NSMutableURLRequest, x: NSData)
proc sendSynchronousRequest*(
class: typedesc[NSURLConnection],
_: NSMutableURLRequest,
x: NSMutableURLRequest,
returningResponse: ptr NSHTTPURLResponse,
error: ptr NSError
): NSData
proc statusCode*(self: NSHTTPURLResponse): int
proc allHeaderFields*(self: NSHTTPURLResponse): NSDictionary
proc URL*(self: NSHTTPURLResponse): NSURL
proc absoluteString*(self: NSURL): NSString
proc absoluteString*(self: NSURL): NSString
6 changes: 3 additions & 3 deletions src/puppy/platforms/macos/objc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ macro objc*(body: untyped) =
fixArg.removeSuffix("_mangle")
sel.add fixArg
else:
if argName != "_":
error("Second arugment needs to be _.", arg)
if argName != "x":
error("Second arugment needs to be x.", arg)
sel.add ":"

# Add second name and type as is.
Expand Down Expand Up @@ -224,4 +224,4 @@ proc alloc*(cls: Class): ID =
)

proc alloc*[T](class: typedesc[T]): T =
class.getClass().alloc().T
class.getClass().alloc().T

0 comments on commit 01abb06

Please sign in to comment.