| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| While working on the mutex contention stats patch for MySQL 5.1.26 (http://code.google.com/p/google-mysq...ontentionStats), I had a few compiler errors because a couple of files include system header files from /usr/include before my_global.h. This means that all of the magic done by my_global to make things somewhat portable are undone for those files because the special-case #define values are not set. In my case, this made it difficult to get __USE_UNIX98 set so that pthread_rwlock_t would be declared. Is there an expectation that my_global.h is included before any system header file? -- Mark Callaghan mdcallag-at-gmail.com -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw |
|
#2
|
| Hi! On Aug 27, MARK CALLAGHAN wrote: > While working on the mutex contention stats patch for MySQL 5.1.26 > (http://code.google.com/p/google-mysq...ontentionStats), > I had a few compiler errors because a couple of files include system > header files from /usr/include before my_global.h. This means that all > of the magic done by my_global to make things somewhat portable are > undone for those files because the special-case #define values are not > set. In my case, this made it difficult to get __USE_UNIX98 set so > that pthread_rwlock_t would be declared. Could you elaborate on this, please ? What file was included before my_global.h, and where ? What magic was undone, how, why ? I couldn't quite understand the problem, sorry ![]() Regards / Mit vielen Grüßen, Sergei -- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Sergei Golubchik / /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect /_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028 <___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer Vorsitzender des Aufsichtsrates: Martin Häring -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw |
|
#3
|
| Hi! >>>>> "Sergei" == Sergei Golubchik Sergei> Hi! Sergei> On Aug 27, MARK CALLAGHAN wrote: >> While working on the mutex contention stats patch for MySQL 5.1.26 >> (http://code.google.com/p/google-mysq...ontentionStats), >> I had a few compiler errors because a couple of files include system >> header files from /usr/include before my_global.h. This means that all >> of the magic done by my_global to make things somewhat portable are >> undone for those files because the special-case #define values are not >> set. In my case, this made it difficult to get __USE_UNIX98 set so >> that pthread_rwlock_t would be declared. Sergei> Could you elaborate on this, please ? Sergei> What file was included before my_global.h, and where ? Sergei> What magic was undone, how, why ? Sergei> I couldn't quite understand the problem, sorry ![]() And to answer your question; For MySQL server code, my_global.h should be included first. Regards, Monty -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw |
|
#4
|
| On Thu, Aug 28, 2008 at 2:22 AM, Sergei Golubchik > Hi! > > On Aug 27, MARK CALLAGHAN wrote: >> While working on the mutex contention stats patch for MySQL 5.1.26 >> (http://code.google.com/p/google-mysq...ontentionStats), >> I had a few compiler errors because a couple of files include system >> header files from /usr/include before my_global.h. This means that all >> of the magic done by my_global to make things somewhat portable are >> undone for those files because the special-case #define values are not >> set. In my case, this made it difficult to get __USE_UNIX98 set so >> that pthread_rwlock_t would be declared. > > Could you elaborate on this, please ? In my case, I want to get the declaration of pthread_rwlock_t, so __USE_UNIX98 must be declared before the code that includes a system header file before including my_global.h, header file and __USE_UNIX98 was not set (because my_global.h had yet to be read). For good reason, I can't force as it #defines a value to prevent that. > What file was included before my_global.h, and where ? This includes storage/archive/azlib.h These include unittest/examples/core-t.c unittest/examples/no_plan-t.c unittest/examples/skip_all-t.c unittest/examples/todo-t.c unittest/mytap/t/basic-t.c > What magic was undone, how, why ? In my case, I need __USE_UNIX98 to be #defined before system header files are read. But my_global.h is full of fixes for platform-specific problems some of which are related to system header files. Whether or not my problem occurs, other problems will occur if code continues to include system header files first. > I couldn't quite understand the problem, sorry ![]() > > Regards / Mit vielen Grüßen, > Sergei > > -- > __ ___ ___ ____ __ > / |/ /_ __/ __/ __ \/ / Sergei Golubchik > / /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect > /_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028 > <___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten > Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer > Vorsitzender des Aufsichtsrates: Martin Häring > -- Mark Callaghan mdcallag-at-gmail.com -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw |
![]() |
| Thread Tools | |
| Display Modes | |