Commit Graph

15 Commits

Author SHA1 Message Date
Hugh Bellamy
05a50fd978 Remove extern "C" from uses of SWIFT_RUNTIME_STDLIB_INTERFACE 2017-01-22 18:32:17 +00:00
practicalswift
2b4a6a573a [gardening] Use nullptr instead of NULL 2017-01-21 10:31:29 +01:00
swift-ci
294359bd69 Merge pull request #4804 from kstaring/master 2017-01-10 00:01:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Hugh Bellamy
eca5b3da34 Change _MSC_VER conditions to _WIN32 conditions in stubs 2016-12-13 14:15:39 +00:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
K Staring
db8878e3e8 incoorporate @landonf and @dcci's suggestions wrt dynamic sysct KERN_PROC_ARGS buffer 2016-10-21 22:23:44 +02:00
K Staring
ede70f2513 rolled back FreeBSD /proc changes and rewrote as per @landonf suggestion, through sysctl() call. Kept the function as similar to the other functions as possible. 2016-10-04 08:47:26 +02:00
K Staring
6428295d70 Two fixes for FreeBSD build
add /usr/local/include to include path in stdlib/public/stubs
use FreeBSD procfs path to cmdline when building for FreeBSD
2016-09-14 20:00:33 +02:00
Vivian Kong
416a36278f Removing SWIFT_CC annotation in SwiftShims 2016-08-10 08:33:24 -04:00
Tony Parker
f65c1390cb Rename Process to CommandLine
Rename Process to CommandLine [SE-0086].
2016-07-18 17:02:02 -07:00
Dmitri Gribenko
61fcdf5fcf Merge pull request #3527 from practicalswift/gardening-20160715
[gardening] Header fixes. Don't compare to false.
2016-07-15 13:12:17 -07:00
practicalswift
967a34e825 [gardening] Use consistent copyright notice (2014 - 2016). 2016-07-15 10:26:22 +02:00
Saleem Abdulrasool
5137f8beec stdlib: repair windows build
When building for a pure windows environment, we build against a newer CRT which
does not provide direct access to __argc, __argv.  They are hidden behind
macros which use a function call.  Use the header (stdlib) to get access to
these rather than declaring them extern.  This also makes the swift runtime more
portable across various Windows environments.

From stdlib.h in ucrt 10.0.10586.0:
  #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
    extern int __argc;
    extern char** __argv;
  #else
    #define __argc (*__p___argc())
    #define __argv (*__p___argv())
  #endif

The indirection is particularly nice on COFF where all module external variables
are indirectly addressed.
2016-07-14 19:48:04 -07:00
Robert Widmann
dc88e51321 Nuke entry-point-based process args
Provides a new fallback for Process arguments for those instances where we do
not own main (e.g. Frameworks, Objective-C owns main.m or main.c, etc.). This
includes a number of platform-specific specializations of argument grabbing
logic and a new thread-safe interface to Process.unsafeArgv.

main()  | _NSGetArgc/_NSGetArgv    | /proc/self/cmdline     | __argc/__argv
--------|--------------------------|------------------------|---------------
Scripts | OS X, iOS, tvOS, watchOS | Linux, FreeBSD, Cygwin | Windows

For interpreted Swift where we must filter out the arguments we now do so by
loading the standard library and calling into new SPI to override the arguments
that would have been grabbed by the runtime. This implementation completely
subsumes the use of the entry point  '_stdlib_didEnterMain' and it will be
removed in a future commit.
2016-07-14 01:06:19 -07:00