2323 * Boston, MA 02110-1301, USA.
2424 */
2525
26- #include "common.h"
27- #include "git2/object.h"
28- #include "hash.h"
29- #include "odb.h"
30-
31- #include "git2/odb_backend.h"
32-
33- #ifdef GIT2_MYSQL_BACKEND
26+ #include <assert.h>
27+ #include <string.h>
28+ #include <git2.h>
29+ #include <git2/odb_backend.h>
3430
3531/* MySQL C Api docs:
3632 * http://dev.mysql.com/doc/refman/5.1/en/c-api-function-overview.html
@@ -177,7 +173,7 @@ int mysql_backend__read(void **data_p, size_t *len_p, git_otype *type_p, git_odb
177173 // return GIT_ERROR;
178174
179175 if (data_len > 0 ) {
180- * data_p = git__malloc (data_len );
176+ * data_p = malloc (data_len );
181177 result_buffers [2 ].buffer = * data_p ;
182178 result_buffers [2 ].buffer_length = data_len ;
183179
@@ -425,7 +421,7 @@ int git_odb_backend_mysql(git_odb_backend **backend_out, const char *mysql_host,
425421 int error ;
426422 my_bool reconnect ;
427423
428- backend = git__calloc (1 , sizeof (mysql_backend ));
424+ backend = calloc (1 , sizeof (mysql_backend ));
429425 if (backend == NULL )
430426 return GIT_ENOMEM ;
431427
@@ -462,22 +458,3 @@ int git_odb_backend_mysql(git_odb_backend **backend_out, const char *mysql_host,
462458 mysql_backend__free ((git_odb_backend * )backend );
463459 return GIT_ERROR ;
464460}
465-
466- #else
467-
468- int git_odb_backend_mysql (git_odb_backend * * GIT_UNUSED (backend_out ), const char * GIT_UNUSED (mysql_host ),
469- const char * GIT_UNUSED (mysql_user ), const char * GIT_UNUSED (mysql_passwd ), const char * GIT_UNUSED (mysql_db ),
470- unsigned int GIT_UNUSED (mysql_port ), const char * GIT_UNUSED (mysql_unix_socket ), unsigned long GIT_UNUSED (mysql_client_flag ))
471- {
472- GIT_UNUSED_ARG (backend_out );
473- GIT_UNUSED_ARG (mysql_host );
474- GIT_UNUSED_ARG (mysql_user );
475- GIT_UNUSED_ARG (mysql_passwd );
476- GIT_UNUSED_ARG (mysql_db );
477- GIT_UNUSED_ARG (mysql_port );
478- GIT_UNUSED_ARG (mysql_unix_socket );
479- GIT_UNUSED_ARG (mysql_client_flag );
480- return GIT_ENOTIMPLEMENTED ;
481- }
482-
483- #endif /* HAVE_MYSQL */
0 commit comments