Skip to content

Commit 4ce4157

Browse files
committed
stdlib: remove unnecessary externs in definitions
The definition may be tagged with `extern`, however, this does nothing. In the header, it may be used to indicate to other TUs that the definition is external to the TU. Remove the unnecessary modifier. NFC.
1 parent 4b0b325 commit 4ce4157

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

stdlib/public/Platform/Misc.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,52 @@
2828

2929
#if !defined(_WIN32) || defined(__CYGWIN__)
3030
SWIFT_CC(swift)
31-
extern int _swift_Platform_open(const char *path, int oflag, mode_t mode) {
31+
int _swift_Platform_open(const char *path, int oflag, mode_t mode) {
3232
return open(path, oflag, mode);
3333
}
3434
#else
3535
SWIFT_CC(swift)
36-
extern int _swift_Platform_open(const char *path, int oflag, int mode) {
36+
int _swift_Platform_open(const char *path, int oflag, int mode) {
3737
return _open(path, oflag, mode);
3838
}
3939
#endif
4040

4141
#if !defined(_WIN32) || defined(__CYGWIN__)
4242
SWIFT_CC(swift)
43-
extern int _swift_Platform_openat(int fd, const char *path, int oflag,
43+
int _swift_Platform_openat(int fd, const char *path, int oflag,
4444
mode_t mode) {
4545
return openat(fd, path, oflag, mode);
4646
}
4747

4848
SWIFT_CC(swift)
49-
extern sem_t *_swift_Platform_sem_open2(const char *name, int oflag) {
49+
sem_t *_swift_Platform_sem_open2(const char *name, int oflag) {
5050
return sem_open(name, oflag);
5151
}
5252

5353
SWIFT_CC(swift)
54-
extern sem_t *_swift_Platform_sem_open4(const char *name, int oflag,
54+
sem_t *_swift_Platform_sem_open4(const char *name, int oflag,
5555
mode_t mode, unsigned int value) {
5656
return sem_open(name, oflag, mode, value);
5757
}
5858

5959
SWIFT_CC(swift)
60-
extern int _swift_Platform_fcntl(int fd, int cmd, int value) {
60+
int _swift_Platform_fcntl(int fd, int cmd, int value) {
6161
return fcntl(fd, cmd, value);
6262
}
6363

6464
SWIFT_CC(swift)
65-
extern int _swift_Platform_fcntlPtr(int fd, int cmd, void* ptr) {
65+
int _swift_Platform_fcntlPtr(int fd, int cmd, void* ptr) {
6666
return fcntl(fd, cmd, ptr);
6767
}
6868

6969
SWIFT_CC(swift)
70-
extern int
70+
int
7171
_swift_Platform_ioctl(int fd, unsigned long int request, int value) {
7272
return ioctl(fd, request, value);
7373
}
7474

7575
SWIFT_CC(swift)
76-
extern int
76+
int
7777
_swift_Platform_ioctlPtr(int fd, unsigned long int request, void* ptr) {
7878
return ioctl(fd, request, ptr);
7979
}
@@ -84,35 +84,36 @@ _swift_Platform_ioctlPtr(int fd, unsigned long int request, void* ptr) {
8484
#include <math.h>
8585

8686
SWIFT_CC(swift)
87-
extern float _swift_Darwin_lgammaf_r(float x, int *psigngam) {
87+
float _swift_Darwin_lgammaf_r(float x, int *psigngam) {
8888
return lgammaf_r(x, psigngam);
8989
}
9090

9191
SWIFT_CC(swift)
92-
extern double _swift_Darwin_lgamma_r(double x, int *psigngam) {
92+
double _swift_Darwin_lgamma_r(double x, int *psigngam) {
9393
return lgamma_r(x, psigngam);
9494
}
9595

9696
SWIFT_CC(swift)
97-
extern long double _swift_Darwin_lgammal_r(long double x, int *psigngam) {
97+
long double _swift_Darwin_lgammal_r(long double x, int *psigngam) {
9898
return lgammal_r(x, psigngam);
9999
}
100100
#endif // defined(__APPLE__)
101101

102102
#if defined(__FreeBSD__)
103-
SWIFT_CC(swift) extern char **_swift_FreeBSD_getEnv() {
103+
SWIFT_CC(swift)
104+
char **_swift_FreeBSD_getEnv() {
104105
extern char **environ;
105106
return environ;
106107
}
107108
#endif // defined(__FreeBSD__)
108109

109110
SWIFT_CC(swift)
110-
extern int _swift_Platform_getErrno() {
111+
int _swift_Platform_getErrno() {
111112
return errno;
112113
}
113114

114115
SWIFT_CC(swift)
115-
extern void _swift_Platform_setErrno(int value) {
116+
void _swift_Platform_setErrno(int value) {
116117
errno = value;
117118
}
118119

0 commit comments

Comments
 (0)