TargetMachO or TargetMacOS

Which should I use to get OS X? Or does it make a difference?

Then do the following to get OSX 10.7 and above:

dim sys2 as Integer
call System.Gestalt("sys2", sys2)
if sys2 > 6 then
--- OSX 10.7 and above
else
--- OSX 10.6 and below

end if

here is code to get everything you need

FUNCTION OSVERSION as STRING

  Dim noerror As Boolean
  Dim result As Integer
  Dim sver As String
  Dim sversion As String
  Dim os As String
  #If TargetMacOS
    noerror=System.Gestalt("sysv",result)
    If noerror Then
      sver=Hex(result)
      sversion=sver.Left(2) + "." + sver.Mid(3,1) + "." + sver.Right(1)
      OS_CODE=Val(sver.Mid(3,1))
      Select Case OS_CODE
        
      Case 0
        os="Cheetah"
      Case 1
        os="Puma"
      Case 2
        os="Jaguar"
      Case 3
        os="Panther"
      Case 4
        os="Tiger"
      Case 5
        os="Leopard"
      Case 6
        os="Snow Leopard"
      Case 7
        os="Lion"
      Case 8
        os="Mountain Lion"
      Case 9
        os="Mavericks"
      Case Else
        os="Unknown"
      End Select
      Return "Mac OSX "+os+" "+sversion
    Else
      Return ""
    End If
  #ElseIf TargetWin32
    
    OS = "Windows"
    
    //try to be more specific of windows version
    Soft Declare Sub GetVersionExA Lib "Kernel32" ( info As Ptr )
    Soft Declare Sub GetVersionExW Lib "Kernel32" ( info As Ptr )
    
    Dim info As MemoryBlock
    
    If System.IsFunctionAvailable( "GetVersionExW", "Kernel32" ) Then
      info =  New MemoryBlock( 20 + (2 * 128) )
      info.Long( 0 ) = info.Size
      GetVersionExW( info )
    Else
      info =  New MemoryBlock( 148 )
      info.Long( 0 ) = info.Size
      GetVersionExA( info )
    End If
    
    Dim Str As String
    OS_CODE=info.Long(4)*100+info.long(8)
    Select Case OS_CODE
    Case 400
      os = "Windows 95/NT 4.0"
    Case 410
      os = "Windows 98"
    Case 490
      os = "Windows Me"
    Case 300 To 399
      os = "Windows NT 3.51"
      OS_CODE=30
    Case 500
      os = "Windows 2000"
    Case 501
      os = "Windows XP"
    Case 502
      os = "Windows Server 2003"
    Case 600
      os = "Windows Vista"
    Case 601
      os = "Windows 7"
    Case 602
      os = "Windows 8"
    End Select
    Str = " Build " + Str( info.Long( 12 ) )
    
    If System.IsFunctionAvailable( "GetVersionExW", "Kernel32" ) Then
      Str = Str + " " + Trim( info.WString( 20 ) )
    Else
      Str = Str + " " + Trim( info.CString( 20 ) )
    End If
    
    os = os + Str
    Return os
  #EndIf

END FUNCTION