[PATCH -v2] Add #includes for C functions to jvmpi_oprofile

View: New views
3 Messages — Rating Filter:   Alert me  

[PATCH -v2] Add #includes for C functions to jvmpi_oprofile

by Maynard Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Newer libstdc++ header files no longer #include standard C header files.  So, for example, C++ source files should now include <cstring> if using any standard C string manipulation functions.  We had done this fix already for other files in the oprofile project, but missed agents/jvmpi/jvmpi_oprofile.cpp since it only gets compiled if configured to use a JDK that's 1.5 or older.

*Suravee*, thanks again for catching the need for stdint.h.  Can you double-check that the attached patch is OK?

-Maynard


diff -paur oprofile/agents/jvmpi/jvmpi_oprofile.cpp op-cstring-fix/agents/jvmpi/jvmpi_oprofile.cpp
--- oprofile/agents/jvmpi/jvmpi_oprofile.cpp 2009-04-28 05:09:47.000000000 -0500
+++ op-cstring-fix/agents/jvmpi/jvmpi_oprofile.cpp 2009-10-14 11:17:14.000000000 -0500
@@ -27,10 +27,12 @@
 #include <iostream>
 #include <map>
 #include <string>
+#include <cstring>
 #include <stdexcept>
 #include <cerrno>
 
 extern "C" {
+#include <stdint.h>
 #include <jvmpi.h>
 #include <opagent.h>
 }
diff -paur oprofile/ChangeLog op-cstring-fix/ChangeLog
--- oprofile/ChangeLog 2009-10-13 16:40:46.000000000 -0500
+++ op-cstring-fix/ChangeLog 2009-10-14 11:19:48.000000000 -0500
@@ -1,3 +1,8 @@
+2009-10-14  Maynard Johnson  <maynardj@...>
+
+ * agents/jvmpi/jvmpi_oprofile.cpp: Add extra #includes since new
+  libstdc++ header files do not include standard C header files
+
 2009-10-13  Maynard Johnson  <maynardj@...>
 
  * utils/opcontrol: Remove incorrect redundant invocation of


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: [PATCH -v2] Add #includes for C functions to jvmpi_oprofile

by Suthikulpanit, Suravee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The patch is good :)

Suravee

On Wed, 2009-10-14 at 15:46 -0500, Maynard Johnson wrote:
> Newer libstdc++ header files no longer #include standard C header files.  So, for example, C++ source files should now include <cstring> if using any standard C string manipulation functions.  We had done this fix already for other files in the oprofile project, but missed agents/jvmpi/jvmpi_oprofile.cpp since it only gets compiled if configured to use a JDK that's 1.5 or older.
>
> *Suravee*, thanks again for catching the need for stdint.h.  Can you double-check that the attached patch is OK?
>
> -Maynard
>



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: [PATCH -v2] Add #includes for C functions to jvmpi_oprofile

by Maynard Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Suravee Suthikulpanit wrote:
> The patch is good :)
Thanks.  Patch applied.

-Maynard

>
> Suravee
>
> On Wed, 2009-10-14 at 15:46 -0500, Maynard Johnson wrote:
>> Newer libstdc++ header files no longer #include standard C header files.  So, for example, C++ source files should now include <cstring> if using any standard C string manipulation functions.  We had done this fix already for other files in the oprofile project, but missed agents/jvmpi/jvmpi_oprofile.cpp since it only gets compiled if configured to use a JDK that's 1.5 or older.
>>
>> *Suravee*, thanks again for catching the need for stdint.h.  Can you double-check that the attached patch is OK?
>>
>> -Maynard
>>
>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list