OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / c-cppbuiltin.c
index 12e0879..c6e5c6d 100644 (file)
@@ -231,7 +231,7 @@ builtin_define_float_constants (const char *name_prefix,
     /* This is an IBM extended double format, so 1.0 + any double is
        representable precisely.  */
       sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b);
-    else      
+    else
       sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b);
   builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);
 
@@ -351,7 +351,7 @@ define__GNUC__ (void)
     builtin_define_with_value_n ("__GNUG__", q, v - q);
 
   gcc_assert (*v == '.' && ISDIGIT (v[1]));
-  
+
   q = ++v;
   while (ISDIGIT (*v))
     v++;
@@ -403,7 +403,7 @@ c_cpp_builtins (cpp_reader *pfile)
 
   if (c_dialect_cxx ())
     {
-      if (flag_weak && SUPPORTS_ONE_ONLY) 
+      if (flag_weak && SUPPORTS_ONE_ONLY)
        cpp_define (pfile, "__GXX_WEAK__=1");
       else
        cpp_define (pfile, "__GXX_WEAK__=0");
@@ -420,7 +420,7 @@ c_cpp_builtins (cpp_reader *pfile)
   if (flag_abi_version == 0)
     /* Use a very large value so that:
 
-         #if __GXX_ABI_VERSION >= <value for version X>
+        #if __GXX_ABI_VERSION >= <value for version X>
 
        will work whether the user explicitly says "-fabi-version=x" or
        "-fabi-version=0".  Do not use INT_MAX because that will be
@@ -432,7 +432,7 @@ c_cpp_builtins (cpp_reader *pfile)
     builtin_define_with_int_value ("__GXX_ABI_VERSION", 102);
   else
     /* Newer versions have values 1002, 1003, ....  */
-    builtin_define_with_int_value ("__GXX_ABI_VERSION", 
+    builtin_define_with_int_value ("__GXX_ABI_VERSION",
                                   1000 + flag_abi_version);
 
   /* libgcc needs to know this.  */
@@ -544,6 +544,9 @@ c_cpp_builtins (cpp_reader *pfile)
   else if (flag_stack_protect == 1)
     cpp_define (pfile, "__SSP__=1");
 
+  if (flag_openmp)
+    cpp_define (pfile, "_OPENMP=200505");
+
   /* A straightforward target hook doesn't work, because of problems
      linking that hook's body when part of non-C front ends.  */
 # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)
@@ -577,7 +580,7 @@ void
 builtin_define_std (const char *macro)
 {
   size_t len = strlen (macro);
-  char *buff = alloca (len + 5);
+  char *buff = (char *) alloca (len + 5);
   char *p = buff + 2;
   char *q = p + len;
 
@@ -623,7 +626,7 @@ builtin_define_with_value (const char *macro, const char *expansion, int is_str)
   if (is_str)
     extra += 2;  /* space for two quote marks */
 
-  buf = alloca (mlen + elen + extra);
+  buf = (char *) alloca (mlen + elen + extra);
   if (is_str)
     sprintf (buf, "%s=\"%s\"", macro, expansion);
   else
@@ -641,7 +644,7 @@ builtin_define_with_value_n (const char *macro, const char *expansion, size_t el
   size_t mlen = strlen (macro);
 
   /* Space for an = and a NUL.  */
-  buf = alloca (mlen + elen + 2);
+  buf = (char *) alloca (mlen + elen + 2);
   memcpy (buf, macro, mlen);
   buf[mlen] = '=';
   memcpy (buf + mlen + 1, expansion, elen);
@@ -659,7 +662,7 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
   size_t vlen = 18;
   size_t extra = 2; /* space for = and NUL.  */
 
-  buf = alloca (mlen + vlen + extra);
+  buf = (char *) alloca (mlen + vlen + extra);
   memcpy (buf, macro, mlen);
   buf[mlen] = '=';
   sprintf (buf + mlen + 1, HOST_WIDE_INT_PRINT_DEC, value);
@@ -736,7 +739,8 @@ builtin_define_type_max (const char *macro, tree type, int is_long)
   value = values[idx + TYPE_UNSIGNED (type)];
   suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
 
-  buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1);
+  buf = (char *) alloca (strlen (macro) + 1 + strlen (value)
+                         + strlen (suffix) + 1);
   sprintf (buf, "%s=%s%s", macro, value, suffix);
 
   cpp_define (parse_in, buf);