Make the pipe headers C++ friendly.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 25 Feb 2008 11:05:41 +0000 (20:05 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 25 Feb 2008 11:05:41 +0000 (20:05 +0900)
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_format.h
src/gallium/include/pipe/p_inlines.h
src/gallium/include/pipe/p_pointer.h
src/gallium/include/pipe/p_state.h
src/gallium/include/pipe/p_util.h
src/gallium/include/pipe/p_winsys.h

index 036c4c8..f69b52f 100644 (file)
 #include "p_state.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+   
 struct pipe_state_cache;
 
 /* Opaque driver handles:
@@ -226,4 +231,9 @@ struct pipe_context {
                  unsigned flags );
 };
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* PIPE_CONTEXT_H */
index 0bf53ec..d84ddbc 100644 (file)
 
 #include "p_format.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define PIPE_BLENDFACTOR_ONE                 0x1
 #define PIPE_BLENDFACTOR_SRC_COLOR           0x2
 #define PIPE_BLENDFACTOR_SRC_ALPHA           0x3
@@ -267,4 +271,8 @@ enum pipe_texture_target {
 #define PIPE_CAP_MAX_TEXTURE_LOD_BIAS    19
 #define PIPE_CAP_BITMAP_TEXCOORD_BIAS    20
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c9ad324..561d2e5 100644 (file)
 #include "p_compiler.h"
 #include "p_debug.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * The PIPE_FORMAT is a 32-bit wide bitfield that encodes all the information
  * needed to uniquely describe a pixel format.
@@ -418,4 +422,8 @@ static INLINE uint pf_get_size( enum pipe_format format ) {
    return pf_get_bits(format) / 8;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index ebf6ed8..de3fa55 100644 (file)
 #include "p_winsys.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 static INLINE void *
 pipe_surface_map(struct pipe_surface *surface)
 {
@@ -109,4 +114,8 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
 }
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* P_INLINES_H */
index e392753..3a1e6be 100644 (file)
 
 #include "p_compiler.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 static INLINE intptr_t
 pointer_to_intptr( const void *p )
 {
@@ -84,4 +88,8 @@ align_pointer( const void *unaligned, uintptr_t alignment )
    return uintptr_to_pointer( aligned );
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* P_POINTER_H */
index 47fa78c..15c8888 100644 (file)
 #include "p_defines.h"
 #include "p_format.h"
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /**
  * Implementation limits
  */
@@ -326,4 +332,8 @@ struct pipe_vertex_element
 };
 
 
+#ifdef __cplusplus
+}
+#endif
+   
 #endif
index 6f0dbda..3b32ba1 100644 (file)
 #include <math.h>
 
 
-#ifdef WIN32
-
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
+
+#ifdef WIN32
+
 void * __stdcall
 EngAllocMem(
     unsigned long Flags,
@@ -51,10 +51,6 @@ void __stdcall
 EngFreeMem(
     void *Mem );
 
-#ifdef __cplusplus
-}
-#endif
-
 static INLINE void *
 MALLOC( unsigned size )
 {
@@ -379,4 +375,8 @@ extern void pipe_copy_rect(ubyte * dst, unsigned cpp, unsigned dst_pitch,
                            int src_pitch, unsigned src_x, int src_y);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 1e81eeb..e784c92 100644 (file)
  * 
  **************************************************************************/
 
-#ifndef P_WINSYS_H
-#define P_WINSYS_H
-
-
-#include "p_format.h"
-
 /**
  * \file
  * This is the interface that Gallium3D requires any window system
  * which is public.
  */
 
+#ifndef P_WINSYS_H
+#define P_WINSYS_H
+
+
+#include "p_format.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /** Opaque type */
 struct pipe_fence_handle;
@@ -156,5 +161,8 @@ struct pipe_winsys
 };
 
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* P_WINSYS_H */