CMake CHECK_FUNCTION_EXISTS for a function requiring #defineWhat does “#define _GNU_SOURCE” imply?Symbol lookup in CMake fails although symbol is presentcmake and libpthreadWhat is CMake equivalent of 'configure --prefix=DIR && make all install '?Debug vs Release in CMakeDefine preprocessor macro through cmakeLooking for a 'cmake clean' command to clear up CMake outputCMake : <pthread.h> not found in WindowsCMake install is not installing libraries on Windowscmake try_compile: Using library found in configurecmake using corrext c++ standard when checking for header filesCMake can find one Boost header file but not another

Character had a different name in the past. Which name should I use in a flashback?

Novel where a cube cooled below absolute zero makes a hole in reality

Why does Taylor’s series “work”?

Are there any crystals that are theoretically possible, but haven't yet been made?

Is it a good idea to teach algorithm courses using pseudocode instead of a real programming language?

Gambler's Fallacy Dice

Bookshelves: the intruder

Is presenting a play showing Military charactes in a bad light a crime in the US?

Very serious stuff - Salesforce bug enabled "Modify All"

How was the blinking terminal cursor invented?

What's is the easiest way to purchase a stock and hold it

How to choose the correct exposure for flower photography?

Head-internal relative clauses

Have the writers and actors of Game Of Thrones responded to its poor reception?

What were the "pills" that were added to solid waste in Apollo 7?

Should I twist DC power and ground wires from a power supply?

How to determine the distribution of Ubuntu

Addressing an email

Why could the Lunar Ascent Engine be used only once?

Latin words remembered from high school 50 years ago

What does this 'x' mean on the stem of the voice's note, above the notehead?

Working hours and productivity expectations for game artists and programmers

Why is python script running in background consuming 100 % CPU?

Who is frowning in the sentence "Daisy looked at Tom frowning"?



CMake CHECK_FUNCTION_EXISTS for a function requiring #define


What does “#define _GNU_SOURCE” imply?Symbol lookup in CMake fails although symbol is presentcmake and libpthreadWhat is CMake equivalent of 'configure --prefix=DIR && make all install '?Debug vs Release in CMakeDefine preprocessor macro through cmakeLooking for a 'cmake clean' command to clear up CMake outputCMake : <pthread.h> not found in WindowsCMake install is not installing libraries on Windowscmake try_compile: Using library found in configurecmake using corrext c++ standard when checking for header filesCMake can find one Boost header file but not another






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I a CMake project, I am trying to test for availability of pthread_setname_np(). As for the headers, this function prototype only seems to be exposed if I #define _GNU_SOURCE first.



Probably for this reason, simply doing



CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)


will not detect the function even though it is present. The documentation mentions CMAKE_REQUIRED_DEFINITIONS but I am not sure how to use it (nor if it is the right way at all).



How can I get CMake to correctly detect the presence of this function?










share|improve this question




























    1















    I a CMake project, I am trying to test for availability of pthread_setname_np(). As for the headers, this function prototype only seems to be exposed if I #define _GNU_SOURCE first.



    Probably for this reason, simply doing



    CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)


    will not detect the function even though it is present. The documentation mentions CMAKE_REQUIRED_DEFINITIONS but I am not sure how to use it (nor if it is the right way at all).



    How can I get CMake to correctly detect the presence of this function?










    share|improve this question
























      1












      1








      1








      I a CMake project, I am trying to test for availability of pthread_setname_np(). As for the headers, this function prototype only seems to be exposed if I #define _GNU_SOURCE first.



      Probably for this reason, simply doing



      CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)


      will not detect the function even though it is present. The documentation mentions CMAKE_REQUIRED_DEFINITIONS but I am not sure how to use it (nor if it is the right way at all).



      How can I get CMake to correctly detect the presence of this function?










      share|improve this question














      I a CMake project, I am trying to test for availability of pthread_setname_np(). As for the headers, this function prototype only seems to be exposed if I #define _GNU_SOURCE first.



      Probably for this reason, simply doing



      CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)


      will not detect the function even though it is present. The documentation mentions CMAKE_REQUIRED_DEFINITIONS but I am not sure how to use it (nor if it is the right way at all).



      How can I get CMake to correctly detect the presence of this function?







      cmake pthreads






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 18:37









      user149408user149408

      2,2721129




      2,2721129






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Yes, CMAKE_REQUIRED_DEFINITIONS is a correct way to test for this function. Here's an example of its use:



          set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
          CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
          unset(CMAKE_REQUIRED_DEFINITIONS)


          You also probably want to read this: What does “#define _GNU_SOURCE” imply?






          share|improve this answer























          • Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

            – user149408
            Mar 25 at 12:06











          • That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

            – arrowd
            Mar 25 at 12:10











          • CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

            – user149408
            Mar 25 at 12:24






          • 1





            Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

            – arrowd
            Mar 25 at 13:19











          • Thanks, that provided the hints I needed. Will post a new answer.

            – user149408
            Mar 25 at 23:05


















          0














          This eventually worked for me (at least on Ubuntu 18.04, currently running CI for others):



          list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
          list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
          CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
          list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)


          Important: make sure you have a clean build environment, with no leftovers from previous builds. For cmake4eclipse, this means:



          • Go to Project > Properties > C/C++ Build > CMake and check Force CMake to run with each build. (You can clear that option again after your first successful build.)

          • Clean your project.

          Appending the pthread library proved necessary for me, otherwise it would not detect the function. The library name seems to be pthreads on some systems (at least I see CMake testing for both); these systems may need further tweaks to detect the function.



          CHECK_FUNCTION_EXISTS instead of CHECK_SYMBOL_EXISTS would have worked as well (I have tried both successfully).






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55317131%2fcmake-check-function-exists-for-a-function-requiring-define%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Yes, CMAKE_REQUIRED_DEFINITIONS is a correct way to test for this function. Here's an example of its use:



            set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
            CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
            unset(CMAKE_REQUIRED_DEFINITIONS)


            You also probably want to read this: What does “#define _GNU_SOURCE” imply?






            share|improve this answer























            • Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

              – user149408
              Mar 25 at 12:06











            • That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

              – arrowd
              Mar 25 at 12:10











            • CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

              – user149408
              Mar 25 at 12:24






            • 1





              Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

              – arrowd
              Mar 25 at 13:19











            • Thanks, that provided the hints I needed. Will post a new answer.

              – user149408
              Mar 25 at 23:05















            1














            Yes, CMAKE_REQUIRED_DEFINITIONS is a correct way to test for this function. Here's an example of its use:



            set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
            CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
            unset(CMAKE_REQUIRED_DEFINITIONS)


            You also probably want to read this: What does “#define _GNU_SOURCE” imply?






            share|improve this answer























            • Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

              – user149408
              Mar 25 at 12:06











            • That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

              – arrowd
              Mar 25 at 12:10











            • CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

              – user149408
              Mar 25 at 12:24






            • 1





              Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

              – arrowd
              Mar 25 at 13:19











            • Thanks, that provided the hints I needed. Will post a new answer.

              – user149408
              Mar 25 at 23:05













            1












            1








            1







            Yes, CMAKE_REQUIRED_DEFINITIONS is a correct way to test for this function. Here's an example of its use:



            set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
            CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
            unset(CMAKE_REQUIRED_DEFINITIONS)


            You also probably want to read this: What does “#define _GNU_SOURCE” imply?






            share|improve this answer













            Yes, CMAKE_REQUIRED_DEFINITIONS is a correct way to test for this function. Here's an example of its use:



            set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
            CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
            unset(CMAKE_REQUIRED_DEFINITIONS)


            You also probably want to read this: What does “#define _GNU_SOURCE” imply?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 24 at 4:19









            arrowdarrowd

            23.3k45684




            23.3k45684












            • Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

              – user149408
              Mar 25 at 12:06











            • That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

              – arrowd
              Mar 25 at 12:10











            • CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

              – user149408
              Mar 25 at 12:24






            • 1





              Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

              – arrowd
              Mar 25 at 13:19











            • Thanks, that provided the hints I needed. Will post a new answer.

              – user149408
              Mar 25 at 23:05

















            • Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

              – user149408
              Mar 25 at 12:06











            • That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

              – arrowd
              Mar 25 at 12:10











            • CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

              – user149408
              Mar 25 at 12:24






            • 1





              Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

              – arrowd
              Mar 25 at 13:19











            • Thanks, that provided the hints I needed. Will post a new answer.

              – user149408
              Mar 25 at 23:05
















            Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

            – user149408
            Mar 25 at 12:06





            Thanks, you’re getting an upvote for this. Alas, it still doesn’t work—CMake does not find the function, despite it being defined in the header file. Could that have to do with the need to define _GNU_SOURCE before including the header (as an answer to your linked question points out)?

            – user149408
            Mar 25 at 12:06













            That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

            – arrowd
            Mar 25 at 12:10





            That's right - you have to define _GNU_SOURCE in both cases: when you testing for pthread_setname_np function and when you're using it within your code. Instead of defining it before including the header, you can also do add_definitions(-D_GNU_SOURCE) in CMakeLists.txt

            – arrowd
            Mar 25 at 12:10













            CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

            – user149408
            Mar 25 at 12:24





            CMake still isn’t picking it up and config.h does not define HAVE_PTHREAD_SETNAME_NP. Same with add_definitions, or with the approach described in stackoverflow.com/q/13541788/2703209 (without touching CMAKE_REQUIRED_LIBRARIES as I don’t think I need any extra here).

            – user149408
            Mar 25 at 12:24




            1




            1





            Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

            – arrowd
            Mar 25 at 13:19





            Take a look at logs located somewhere in your build directory. Specifically, CMakeFiles/ dir.

            – arrowd
            Mar 25 at 13:19













            Thanks, that provided the hints I needed. Will post a new answer.

            – user149408
            Mar 25 at 23:05





            Thanks, that provided the hints I needed. Will post a new answer.

            – user149408
            Mar 25 at 23:05













            0














            This eventually worked for me (at least on Ubuntu 18.04, currently running CI for others):



            list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
            list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
            CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
            list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)


            Important: make sure you have a clean build environment, with no leftovers from previous builds. For cmake4eclipse, this means:



            • Go to Project > Properties > C/C++ Build > CMake and check Force CMake to run with each build. (You can clear that option again after your first successful build.)

            • Clean your project.

            Appending the pthread library proved necessary for me, otherwise it would not detect the function. The library name seems to be pthreads on some systems (at least I see CMake testing for both); these systems may need further tweaks to detect the function.



            CHECK_FUNCTION_EXISTS instead of CHECK_SYMBOL_EXISTS would have worked as well (I have tried both successfully).






            share|improve this answer



























              0














              This eventually worked for me (at least on Ubuntu 18.04, currently running CI for others):



              list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
              list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
              CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
              list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)


              Important: make sure you have a clean build environment, with no leftovers from previous builds. For cmake4eclipse, this means:



              • Go to Project > Properties > C/C++ Build > CMake and check Force CMake to run with each build. (You can clear that option again after your first successful build.)

              • Clean your project.

              Appending the pthread library proved necessary for me, otherwise it would not detect the function. The library name seems to be pthreads on some systems (at least I see CMake testing for both); these systems may need further tweaks to detect the function.



              CHECK_FUNCTION_EXISTS instead of CHECK_SYMBOL_EXISTS would have worked as well (I have tried both successfully).






              share|improve this answer

























                0












                0








                0







                This eventually worked for me (at least on Ubuntu 18.04, currently running CI for others):



                list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
                list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
                CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
                list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)


                Important: make sure you have a clean build environment, with no leftovers from previous builds. For cmake4eclipse, this means:



                • Go to Project > Properties > C/C++ Build > CMake and check Force CMake to run with each build. (You can clear that option again after your first successful build.)

                • Clean your project.

                Appending the pthread library proved necessary for me, otherwise it would not detect the function. The library name seems to be pthreads on some systems (at least I see CMake testing for both); these systems may need further tweaks to detect the function.



                CHECK_FUNCTION_EXISTS instead of CHECK_SYMBOL_EXISTS would have worked as well (I have tried both successfully).






                share|improve this answer













                This eventually worked for me (at least on Ubuntu 18.04, currently running CI for others):



                list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
                list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
                CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
                list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)


                Important: make sure you have a clean build environment, with no leftovers from previous builds. For cmake4eclipse, this means:



                • Go to Project > Properties > C/C++ Build > CMake and check Force CMake to run with each build. (You can clear that option again after your first successful build.)

                • Clean your project.

                Appending the pthread library proved necessary for me, otherwise it would not detect the function. The library name seems to be pthreads on some systems (at least I see CMake testing for both); these systems may need further tweaks to detect the function.



                CHECK_FUNCTION_EXISTS instead of CHECK_SYMBOL_EXISTS would have worked as well (I have tried both successfully).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 25 at 23:36









                user149408user149408

                2,2721129




                2,2721129



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55317131%2fcmake-check-function-exists-for-a-function-requiring-define%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript