Changeset 14045

Show
Ignore:
Timestamp:
11/21/14 21:16:16 (28 hours ago)
Author:
robert
Message:

From Alberto Luaces,"the current code uses the preprocessor for generating the plugin path in
a way that when CMAKE_INSTALL_PREFIX contains something along the lines
of

/usr/x86_64-linux-gnu/

it gets substituted as

/usr/x86_64-1-gnu/

that is, the string is preprocessed again, thereby making changes to
anything that matches any defined symbol, as "linux" in this example
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763816).

Quoting that path directly in CMake scripts solves that problem.
"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ply/plyfile.cpp

    r13041 r14045  
    301301) 
    302302{ 
    303   PlyFile *plyfile; 
    304   char *name; 
    305   FILE *fp; 
    306  
    307  
    308   /* tack on the extension .ply, if necessary */ 
    309   name = (char *) myalloc (sizeof (char) * 
    310                            (static_cast<int>(strlen (filename)) + 5)); 
    311   strcpy (name, filename); 
    312   if (strlen (name) < 4 || 
    313       strcmp (name + strlen (name) - 4, ".ply") != 0) 
    314       strcat (name, ".ply"); 
    315  
    316303  /* open the file for writing */ 
    317304 
    318   fp = osgDB::fopen (name, "wb"); 
    319   free (name); //wjs remove memory leak// 
     305  FILE *fp = osgDB::fopen (filename, "wb"); 
    320306  if (fp == NULL) { 
    321307    return (NULL); 
     
    324310  /* create the actual PlyFile structure */ 
    325311 
    326   plyfile = ply_write (fp, nelems, elem_names, file_type); 
     312  PlyFile *plyfile = ply_write (fp, nelems, elem_names, file_type); 
    327313 
    328314  // If the plyfile could not load return NULL 
     
    947933  FILE *fp; 
    948934  PlyFile *plyfile; 
    949   char *name; 
    950  
    951   /* tack on the extension .ply, if necessary */ 
    952  
    953   name = (char *) myalloc (sizeof (char) * 
    954                            (static_cast<int>(strlen (filename) + 5))); 
    955   strcpy (name, filename); 
    956   if (strlen (name) < 4 || 
    957       strcmp (name + strlen (name) - 4, ".ply") != 0) 
    958       strcat (name, ".ply"); 
    959935 
    960936  /* open the file for reading */ 
    961  
    962   fp = osgDB::fopen (name, "rb"); 
    963   free(name); 
     937  fp = osgDB::fopen (filename, "rb"); 
    964938  if (fp == NULL) 
    965939    return (NULL); 
     
    971945  if(!plyfile) 
    972946  { 
    973     std::cout<<"Ply File Error : Could not read file"<<std::endl; 
     947    std::cout<<"Ply File Error : Could not read file " << filename <<std::endl; 
    974948    return NULL; 
    975949  }