Hash :
c9bf5465
Author :
Date :
2024-08-12T11:47:16
Reland "Remove the linkage-specification on `main`" This is a reland of commit b60dc9d59aad03e641b86431c277c877d4ca9d7a Original change's description: > Remove the linkage-specification on `main` > > According to the standard, the main function should have no > linkage-specification [1]. New version of clang will enforce > this via a warning [2] which causes build failure if building > with `-Werror` which treats warnings as error. > > Remove the superfluous linkage-specification to fix the error. > > [1]: https://eel.is/c++draft/basic.start#main-3 > [2]: https://github.com/llvm/llvm-project/pull/101853 > > Fixed: chromium:358427300 > Change-Id: I541166cbd122c7e296ecdd2b5a9f9a107fe82872 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5782349 > Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Fixed: chromium:358427300 Change-Id: I380fdf74dc2a056f94af35c5c6c566a88d750c7d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5785953 Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ios_main.mm: Alternative entry point for iOS executables that initializes UIKit before calling
// the default entry point.
#import <UIKit/UIKit.h>
#include <stdio.h>
static int original_argc;
static char **original_argv;
int main(int argc, char **argv);
@interface AngleUtilAppDelegate : UIResponder <UIApplicationDelegate>
@property(nullable, nonatomic, strong) UIWindow *window;
@end
@implementation AngleUtilAppDelegate
@synthesize window;
- (void)runMain
{
exit(main(original_argc, original_argv));
}
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
[self.window makeKeyAndVisible];
// We need to return from this function before the app finishes launching, so call main in a
// timer callback afterward.
[NSTimer scheduledTimerWithTimeInterval:0
target:self
selector:@selector(runMain)
userInfo:nil
repeats:NO];
return YES;
}
@end
extern "C" int ios_main(int argc, char **argv)
{
original_argc = argc;
original_argv = argv;
return UIApplicationMain(argc, argv, nullptr, NSStringFromClass([AngleUtilAppDelegate class]));
}